home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / tcomm40 / lc.doc next >
Text File  |  1988-10-06  |  126KB  |  4,621 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                       OVERVIEW                                      OVERVIEW                                      ________
  10.  
  11.  
  12.             FEATURES            FEATURES            ________
  13.  
  14.  
  15.             The LiteComm Toolbox(TM) is a set of powerful routines
  16.             designed to provide easy access to the full capabilities of
  17.             the PC's asynchronous communications ports. In its initial
  18.             release, the LiteComm ToolBox supports fully interrupt-
  19.             driven and buffered communications support on COM1 thru COM4
  20.             simultaneously. Now you can quickly incorporate
  21.             sophisticated communications support in your applications
  22.             without having in-depth knowledge of how the hardware
  23.             functions.
  24.  
  25.  
  26.             The ToolBox was developed as the result of a need to provide
  27.             just this type of support in CAM applications which were
  28.             developed for a client. Each version of the LiteComm ToolBox
  29.             is heavily integrated with its respective host compiler.
  30.  
  31.  
  32.  
  33.             THE SHAREWARE CONCEPT            THE SHAREWARE CONCEPT            _____________________
  34.  
  35.  
  36.             Shareware is a "try before you buy" means of software
  37.             distribution. If you find a shareware product useful, pay
  38.             the registration fee, and let the authors know that you
  39.             support their efforts.
  40.  
  41.  
  42.             Information Technology, Ltd., is a member  and supports the
  43.             standards of, ASP, The Association of Shareware
  44.             Professionals.
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  71.                              for Microsoft and Turbo C
  72.  
  73.                          LICENSE, WARRANTY AND REGISTRATION                         LICENSE, WARRANTY AND REGISTRATION                         __________________________________
  74.  
  75.  
  76.             LICENSE            LICENSE            _______
  77.  
  78.  
  79.             The LiteComm ToolBox, small model library only, is
  80.             distributed as a shareware product. To receive all model
  81.             libraries and/or the source code for the product, register
  82.             your copy today. See the registration form at the end of
  83.             this manual.
  84.  
  85.  
  86.             Information Technology, Ltd, grants to registered users a
  87.             non-exclusive, perpetual license to the LiteComm ToolBox,
  88.             subject to these terms and conditions:
  89.  
  90.  
  91.  
  92.                 1. You must treat your copy of the LiteComm Toolbox
  93.                    as you would a book.  You may install the
  94.                    LiteComm ToolBox on more than one machine, but
  95.                    you may use only one copy at a time.  If you
  96.                    desire, site licenses are available at a reduced
  97.                    cost.  You may make as many copies of the
  98.                    LiteComm ToolBox as you require for the sole
  99.                    purpose of backup.
  100.  
  101.  
  102.                 2. You may incorporate portions of the LiteComm
  103.                    ToolBox in products that you develop without the
  104.                    payment of additional royalties or license fees.
  105.                    You must include the statement 'Portions
  106.                    Copyright 1987, 1988, Information Technology,
  107.                    Ltd' in your product's documentation.
  108.  
  109.  
  110.                 3. You may copy and redistribute the shareware
  111.                    portion of the LiteComm ToolBox, commonly known
  112.                    as MCOMM.ARC and TCOMM.ARC, but you may not
  113.                    modify in any way, the contents of the shareware
  114.                    package.  Further, you may not charge a fee for
  115.                    providing such a copy, beyond a maximum $4.00
  116.                    copying or duplication fee, without the express,
  117.                    written consent of Information Technology, Ltd,
  118.  
  119.  
  120.                 4. You may not redistribute, in any form, the
  121.                    source code for the LiteComm ToolBox.  Further,
  122.                    you may not translate the source code for the
  123.                    LiteComm ToolBox into any other language without
  124.                    the express, written consent of Information
  125.                    Technology, Ltd.
  126.  
  127.  
  128.  
  129.  
  130.                                        Page 2
  131.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  132.  
  133.  
  134.  
  135.  
  136.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  137.                              for Microsoft and Turbo C
  138.  
  139.                 5. Information Technology reserves the right to
  140.                    change both the LiteComm ToolBox or its
  141.                    documentation without prior notice, with no
  142.                    obligation to you, the licensee.
  143.  
  144.  
  145.                 6. You agree that any disputes arising from this
  146.                    license will be subject to the laws of the state
  147.                    of Rhode Island.
  148.  
  149.  
  150.                 7. You agree to hold the developer and distributors
  151.                    of the LiteComm ToolBox harmless for any
  152.                    damages, either direct or consequential, that
  153.                    might arise from the use of this product.
  154.  
  155.  
  156.                 8. You acknowledge that the LiteComm ToolBox,
  157.                    libraries, source code, and documentation are
  158.                    the copyrighted property of Information
  159.                    Technology, Ltd.
  160.  
  161.  
  162.                 9. By your use of the LiteComm ToolBox, you
  163.                    acknowledge that you have read, and understand
  164.                    the terms and conditions of this license.
  165.  
  166.  
  167.             WARRANTY            WARRANTY            ________
  168.  
  169.  
  170.             The LiteComm ToolBox is distributed as-is and without
  171.             warranty, including, but not limited to, the implied
  172.             warranties of merchantability and fitness for a particular
  173.             purpose.
  174.  
  175.  
  176.             Information Technology, Ltd does warrant the distribution
  177.             media for a period of 30 days.  During that period,
  178.             Information Technology, Ltd will replace the distribution
  179.             media or provide a refund at its option.
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                                        Page 3
  197.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  198.  
  199.  
  200.  
  201.  
  202.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  203.                              for Microsoft and Turbo C
  204.  
  205.             REGISTERING YOUR COPY            REGISTERING YOUR COPY            _____________________
  206.  
  207.  
  208.             Registration of your copy of the LiteComm ToolBox provides
  209.             you with several benefits:
  210.  
  211.  
  212.  
  213.                 1. Puts you on our mailing list for low-cost
  214.                    updates, enhancements, and alert bulletins when
  215.                    they occur.
  216.  
  217.  
  218.                 2. Gives you access to telephone support. Sorry,
  219.                    but we cannot provide support by telephone to
  220.                    unregistered user's of the ToolBox. Unregistered
  221.                    users can leave EMAIL on Compuserve to
  222.                    70166,1152; on GEnie to I.TECH; and on DELPHI to
  223.                    RBMACE. We will respond to EMAIL on an as-
  224.                    available basis.
  225.  
  226.  
  227.                 3.Helps to further the shareware concept.
  228.  
  229.             To register your copy, use the form at the end of this
  230.             documentation.
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                                        Page 4
  263.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  264.  
  265.  
  266.  
  267.  
  268.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  269.                              for Microsoft and Turbo C
  270.  
  271.             NOTE            NOTE            ____
  272.  
  273.  
  274.             LiteComm is a package undergoing continuing development.
  275.             Since its introduction, we have already delivered to
  276.             registered users two protocol engines, LXM - the XMODEM
  277.             engine, which supports both XMODEM and YMODEM protocols and
  278.             LWXM - the Windowed XMODEM engine.
  279.  
  280.             
  281.  
  282.             Implementations of other Xmodem variants are under
  283.             development. We plan to follow these with similar engines
  284.             for CompuServe B, Telink, and other protocols. These
  285.             engines, as they are released, will only be made available
  286.             to registered ToolBox users. The small model library, as
  287.             enhanced but without the protocol engines, will continue to
  288.             be offered as shareware.
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                                        Page 5
  329.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  330.  
  331.  
  332.  
  333.  
  334.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  335.                              for Microsoft and Turbo C
  336.  
  337.                              COMMUNICATIONS AND THE PC                             COMMUNICATIONS AND THE PC                             _________________________
  338.  
  339.  
  340.             PC SHORTCOMINGS            PC SHORTCOMINGS            _______________
  341.  
  342.  
  343.             This section is intended as a mini-tutorial on            ______________________________________________
  344.             communications concepts. We encourage you to read it,            _____________________________________________________
  345.             although it is not strictly necessary to do so.            _______________________________________________
  346.  
  347.  
  348.             The IBM-PC, and its close compatibles, is a generally well
  349.             thought-out, flexible, and well-executed computer.
  350.             Unfortunately, not as much can be said for the thought which
  351.             was given to the software which is meant to provide access
  352.             to that hardware. One of the shortcomings which is most
  353.             noticeable is in the support, or rather lack of it, that is
  354.             provided to handle access to the serial port. Support for
  355.             the serial port is limited by the BIOS to polled mode only,
  356.             i.e. a program must interrogate the port on a regular basis
  357.             to avoid losing received characters, and to check to
  358.             determine whether or not the port is ready to send a
  359.             character. Not only is this mode of operation primitive; it
  360.             also tends to cause complications when attempting to perform
  361.             any but the simplest of tasks, at slow speeds.
  362.  
  363.  
  364.             A novice might think that the hardware, in some way, is the
  365.             limiting factor. In fact, everything that is needed,
  366.             hardware-wise, to support a more sophisticated method of
  367.             handling the serial port is already there. All that is
  368.             missing is the software follow-through. The LiteComm ToolBox
  369.             provides this missing software.
  370.  
  371.  
  372.  
  373.             THE 8250 UART            THE 8250 UART            _____________
  374.  
  375.  
  376.             The term serial port comes from the fact that both incoming
  377.             and outgoing characters entering and leaving the port do so
  378.             in a bitwise fashion. When we send a character out the
  379.             serial port, the responsible circuitry sends out information
  380.             one bit at a time. When we receive a character, this
  381.             circuitry accepts the individual bits and reassembles them
  382.             into a recognizable character. These very complex operations
  383.             are performed automatically by the 8250 UART (Universal
  384.             Asynchronous Receiver-Transmitter).
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.                                        Page 6
  395.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  396.  
  397.  
  398.  
  399.  
  400.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  401.                              for Microsoft and Turbo C
  402.  
  403.             The 8250 UART is a fully programmable device that permits
  404.             independent control of the various parameters that affect
  405.             serial communications, i.e. baud rate, parity, number of
  406.             data bits, and number of stop bits. The 8250 also optionally
  407.             supports four types of interrupts, error/break detection,
  408.             modem status change detection, transmitter ready, and
  409.             received character ready. The LiteComm ToolBox fully
  410.             supports all four type of interrupts.
  411.  
  412.  
  413.             The term asynchronous implies that there is no absolute                     asynchronous                                                       ____________                                  
  414.             timing associated with the transmission of information.
  415.             Instead, the clocking-in of the data bits is done by                         clocking-in                                                     ___________                            
  416.             counting the bits. The first bit sent or received is call
  417.             the start bit and signals the beginning of a new character.
  418.             The individual data bits follow the start bit which are
  419.             clocked out and in at the specified data rate, with the
  420.             least significant bit transferred first and the parity bit,
  421.             if present, transferred last. Finally one or more stop bits
  422.             follow, signalling the end of the character.
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.                                        Page 7
  461.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  462.  
  463.  
  464.  
  465.  
  466.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  467.                              for Microsoft and Turbo C
  468.  
  469.             The 8250 UART takes care of all of the mechanics associated
  470.             with the process described in the preceding paragraph. The
  471.             UART will also detect and report error which may occur in
  472.             the process. For example, if the parity bit is incorrect,
  473.             the UART reports the fact. If too few or too many bits are
  474.             received, the UART will report a framing error or overrun
  475.             error respectively.
  476.  
  477.  
  478.             Since the transmission of information may depend on complex
  479.             interactions with another device, such as a modem or
  480.             computer, the 8250 can also report on the status of the
  481.             handshake lines used to provide information about the status            handshake                                                               _________                                                   
  482.             of the connection with the other device. These signals are
  483.             explained below.
  484.  
  485.  
  486.  
  487.  
  488.                                 SIGNAL DESCRIPTIONS
  489.             
  490.            _______________________________________________________________
  491.            |                                                             |
  492.                       CTS    Clear To Send     The other device will           |                                                             |
  493.                                                accept a transmission.           |                                                             |
  494.                       DSR    Data Set Ready    The other device           |                                                             |
  495.                                                is enabled.           |                                                             |
  496.                       RI     Ring Indicator    Usually reserved           |                                                             |
  497.                                                for modems only. The           |                                                             |
  498.                                                phone is ringing           |                                                             |
  499.                       DCD    Carrier Detect    Usually reserved for           |                                                             |
  500.                                                modems. The other modem's           |                                                             |
  501.                                                 carrier signal was           |                                                             |
  502.                                                detected.           |                                                             |
  503.            _______________________________________________________________           |                                                             |
  504.  
  505.             The header file for the LiteComm ToolBox contains the
  506.             various bit masks required for you to make use of the
  507.             information provided by the 8250 UART.
  508.  
  509.  
  510.  
  511.             TOOLBOX NOTES AND WARNINGS            TOOLBOX NOTES AND WARNINGS            __________________________
  512.  
  513.  
  514.             Before you can send or receive information on a serial port
  515.             using the ToolBox, you must use the open function to enable
  516.             the line. This function initializes the 8250 UART with the
  517.             correct parameters, and introduces the UART into the
  518.             interrupt structure of the PC. The ToolBox will detect, and
  519.             report, any errors that you may make in selecting the port
  520.             or specifying the initial parameters. The ToolBox cannot and
  521.             will not detect an attempt to open a non-existent serial
  522.             port.
  523.  
  524.  
  525.  
  526.                                        Page 8
  527.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  528.  
  529.  
  530.  
  531.  
  532.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  533.                              for Microsoft and Turbo C
  534.  
  535.             The ToolBox interfaces directly with the interrupt structure
  536.             of the PC. It is critical that, before exiting a program
  537.             that has opened a serial port that the serial port is closed
  538.             with the close function. If you exit your program without
  539.             closing the port, you may cause your system to crash since
  540.             the interrupt vector for the port might point to a section
  541.             of memory that no longer contains the needed code to support
  542.             the interrupt.  As an alternative, some C compilers provide
  543.             a function that permits you to introduce your own routines
  544.             into the normal exit() processing.  Since each of these
  545.             schemes has different requirements, we suggest that you
  546.             consult your compiler's documentation.
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.                                        Page 9
  593.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  594.  
  595.  
  596.  
  597.  
  598.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  599.                              for Microsoft and Turbo C
  600.  
  601.             Failure of the open function can be the result of either
  602.             improper parameters to the open function, or insufficient
  603.             memory available to allocate the requested buffers and
  604.             related control structures for the port. Memory for the
  605.             transmit and receive buffers as well as the port control
  606.             block are allocated from free memory. It is your
  607.             responsibility to insure that adequate memory is available
  608.             for this purpose.
  609.  
  610.  
  611.             Unless you are very familiar with the interrupt structure of
  612.             the PC, do not attempt to manipulate the interrupt enable
  613.             flag outside of the ToolBox. The ToolBox sets and clears the
  614.             interrupt enable flag at appropriate times and assumes that
  615.             it has sole control over the flag.
  616.  
  617.  
  618.             Unless otherwise specified, all library functions have been
  619.             compiled with the default structure alignment, i.e. the
  620.             structure alignment switch has not been used in creating the
  621.             ToolBox library.
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.                                       Page 10
  659.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  660.  
  661.  
  662.  
  663.  
  664.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  665.                              for Microsoft and Turbo C
  666.  
  667.                                    RECENT CHANGES                                   RECENT CHANGES                                   ______________
  668.  
  669.  
  670.             NEW IN VERSION 2.XX            NEW IN VERSION 2.XX            ___________________
  671.  
  672.  
  673.             With version 2.0 of LiteComm, we added several new functions
  674.             and made available, to registered users,the xmodem engine
  675.             promised when LiteComm was first released.
  676.  
  677.  
  678.             Version 2.1 of LiteComm further expanded upon COM3 and COM4
  679.             support by supporting interrupt chaining, permitting COM3
  680.             and COM4 to augment, rather than replace, existing
  681.             interrupts.
  682.  
  683.  
  684.             Version 2.12 was a maintenance release, and did not
  685.             incorporate any new functionality. It was discovered, during
  686.             the development of the Windowed XModem engine that there was
  687.             a bug in the automatic XON-XOFF feature which could cause
  688.             the transmit buffer to overflow under some circumstances.
  689.             Version 2.12 corrected this problem.
  690.  
  691.  
  692.             Several user-reported bugs were also corrected in 2.12.Our
  693.             thanks to Jerry Wasinger for his reports of several of these
  694.             problems.  We also want to thank Jerry for his providing an
  695.             alternate approach to handling the transmission of BREAK
  696.             characters (see the lc_sbrk function).With Jerry's
  697.             permission, we have based an alternate function on some of
  698.             his efforts.
  699.  
  700.  
  701.             With version 2.20, we introduced the second of out protocol
  702.             engines, this one for the increasingly-popular Windowed
  703.             XMODEM.  As with LXM, LWXM (LiteComm Windowed XModem) is
  704.             available to LiteComm registrants only.
  705.  
  706.  
  707.             Version 2.50 marks the beginning of support for Microsoft
  708.             C,version 5.0 and QuickC.  In version 2.5 of the ToolBox,
  709.             the original lc_sbrk function as been removed and only
  710.             lc_sbrk2 is supported. For the sake of compatibility with
  711.             previous versions, lc_sbrk2 has been renamed to lc_sbrk.
  712.             Version 2.50 also includes a new function, lc_ocnt that
  713.             returns the number of characters in the output buffer.
  714.  
  715.  
  716.             Version 2.60 corrects a bug in the lc_gets function that has
  717.             gone undetected since version 1.0.  The bug was such that
  718.             the function would repeatedly return the same characters,
  719.             unless the requested number of characters forced a buffer
  720.             wrap-around to occur.
  721.  
  722.  
  723.  
  724.                                       Page 11
  725.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  726.  
  727.  
  728.  
  729.  
  730.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  731.                              for Microsoft and Turbo C
  732.  
  733.             Version 2.60 also enhances the capabilities of the XModem
  734.             protocol engine, adding YModem support for further
  735.             efficiency.
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.                                       Page 12
  791.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  792.  
  793.  
  794.  
  795.  
  796.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  797.                              for Microsoft and Turbo C
  798.  
  799.             NEW IN VERSION 3.00            NEW IN VERSION 3.00            ___________________
  800.  
  801.  
  802.             Version 3.00 incorporates changes in several areas.  It is
  803.             with regret that, due to a lack of interest, we have been
  804.             forced to drop support for the Datalight C compiler.  While
  805.             we feel that Datalight offers a superior product at an
  806.             affordable price, the lack of registrants for this version
  807.             do not justify the continued support.
  808.  
  809.  
  810.             Additional effort has been spent on further tightening the
  811.             kernel code to improve the ability of LiteComm to handle
  812.             higher baud rates.  Our tests indicate that sustained speeds
  813.             of 38.4 Kbaud should be practical.  And for added
  814.             flexibility, we have made the Baud parameter used in the
  815.             comm_opn and comm_setup functions infinitely variable.
  816.             There is no longer the need to use the defined constants in
  817.             the litecomm.h header file.  Please note that to achieve
  818.             these peformance improvements that the litecomm.h file has
  819.             changed, requiring that you re-compile and relink any
  820.             existing applications.
  821.  
  822.  
  823.             We have added a function that should be of use to those of
  824.             you that have a need to DETECT when a break signal has been
  825.             received.  See the documentation for lc_gotbrk, found in the
  826.             section dealing with lc_sbrk.
  827.  
  828.  
  829.             As the result of questions and difficulty for users in
  830.             dealing with the lc_mstat function, the way in which the
  831.             function operates has been substantially altered.
  832.  
  833.  
  834.             Version 3.00 also corrects a bug that was recently detected
  835.             in the lch_sreg function.  The bug caused the intended value
  836.             to be ignored, and the value of the register was being set
  837.             to the register number itself.  Our apologies for this
  838.             oversight.
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.                                       Page 13
  857.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  858.  
  859.  
  860.  
  861.  
  862.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  863.                              for Microsoft and Turbo C
  864.  
  865.             NEW IN VERSION 4.00            NEW IN VERSION 4.00            ___________________
  866.  
  867.  
  868.             With version 4.0, we have made a significant departure from
  869.             the design of the previous versions.  In the previous
  870.             versions, with one small exception, LiteComm was written
  871.             entirely in C.  While the scheme was useful from the
  872.             standpoint of enhancements and maintainability, it also
  873.             introduced an inherent inefficiency into the interrupt
  874.             handlers, limiting the baud rates that could be attained.
  875.             With version 4, the critical interrupt handlers have been
  876.             recoded in assembly language to expand the range of suitable
  877.             baud rates.  In addition, while interrupt processing is in
  878.             progress, the interrupt handlers now switch to their own
  879.             internal stacks, to avoid any possibility of stack overflow.
  880.  
  881.  
  882.             In response to many questions, we have added several new
  883.             functions to the LiteComm package that both serve as
  884.             tutorials on how to address certain problems ('How do I tell
  885.             if the phone is ringing, and how do I answer the call' for
  886.             example) and are of practical use in certain applications,
  887.             such as the development of a Bulletin Board.  We know you
  888.             will find a use for them. See the section of the BBS support
  889.             functions.
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.                                       Page 14
  923.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  924.  
  925.  
  926.  
  927.  
  928.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  929.                              for Microsoft and Turbo C
  930.  
  931.                                     BEYOND COM2                                    BEYOND COM2                                    ___________
  932.  
  933.  
  934.             THE TOOLBOX METHODOLOGY            THE TOOLBOX METHODOLOGY            _______________________
  935.  
  936.  
  937.             In the design of the original PC, and in subsequent
  938.             variations such as the PC/AT, there were only provision for
  939.             two serial ports. Many manufacturers of add-in products,
  940.             both serial ports and internal modems have added the
  941.             capability to support 1 or more additional ports beyond the
  942.             COM2 limit. Generally, this can cause problems in the PC
  943.             since there is no room in the interrupt request scheme for
  944.             additional levels of interrupts, and there are no designated
  945.             interrupt vector for other additional ports.
  946.  
  947.  
  948.             The ToolBox approach to resolving these issues is to permit
  949.             the programmer a degree of control over the parameters that
  950.             govern the interrupt mechanism for COM3 and COM4.
  951.             Specifically, these parameters are: 1) the interrupt request
  952.             (IRQ) bit that is used to mask the 8259 interrupt
  953.             controller; 2) the interrupt vector number (not address) to
  954.             which the port is attached; and 3) the base i/o register for
  955.             the port itself. Of course, it is assumed that the port is
  956.             based upon the 8250 UART or compatible device.
  957.  
  958.  
  959.             Before you attempt to use COM3 and/or COM4, you must
  960.             determine from the port's documentation, the appropriate
  961.             values for these three parameters. As distributed, the
  962.             ToolBox assumes the following:
  963.  
  964.             
  965.             
  966.                                   COM3        COM4                                  ____        ____
  967.             
  968.                       IRQ Bit      4           3
  969.                       Vector #    0Ch         0Bh
  970.                       Base Reg    3E8h        2E8h
  971.  
  972.             You may change any or all of these values by using the
  973.             _portchg function described below, but only before you open
  974.             the port with comm_opn. Once the port has been opened,
  975.             _portchg is ineffective, and _portchg will not work on COM1
  976.             or COM2.
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.                                       Page 15
  989.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  990.  
  991.  
  992.  
  993.  
  994.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  995.                              for Microsoft and Turbo C
  996.  
  997.             CAUTIONS            CAUTIONS            ________
  998.  
  999.  
  1000.             There is an intimate relationship between the IRQ setting
  1001.             and the interrupt vector to which it relates. In the PC,
  1002.             this relationship is controlled, in part, by the 8259
  1003.             interrupt controller that is set during BIOS initialization.
  1004.  
  1005.  
  1006.             In brief, the BIOS settings for the PC (and most close
  1007.             compatibles) establish IRQ0 as being vector number 08h, and
  1008.             subsequent IRQ levels at increasing vector numbers. These
  1009.             vector numbers (or types in INTEL terms) act as a cpu-
  1010.             directed call table to locations in the lowest 1K of system
  1011.             memory. We can alter how the system responds to a given
  1012.             interrupt by replacing or changing the values in the
  1013.             associated vector position to point to a routine which we
  1014.             supply.
  1015.  
  1016.  
  1017.             COM3 and COM4 share two critical parameters with COM1 and
  1018.             COM2 respectively, the IRQ bit and the interrupt vector
  1019.             number. If you intend to use COM1 with COM3 or COM2 with
  1020.             COM4 simultaneously, you must change the BOTH the vector
  1021.             number and the IRQ for COM3 or COM4 to an unused or un-
  1022.             needed vector. The ability for your add-on ports to handle
  1023.             such a change is highly hardware dependent, so check your
  1024.             port's documentation carefully. Failure to do so will result
  1025.             in loss of data at best, and a system lockup at worst.
  1026.  
  1027.  
  1028.             Judging from the questions asked by some users of LiteComm,
  1029.             there is evidently some mis-understanding about using ports
  1030.             beyond COM2, and how this all relates to your hardware.
  1031.             Before you can successfully use COM3 or COM4, you must
  1032.             consider the following:
  1033.  
  1034.  
  1035.  
  1036.                 1. Does the hardware permit a change to the base
  1037.                    port and/or the interrupt vector to which the
  1038.                    port responds.  Some expansion cards will
  1039.                    support changing one and not the other, giving
  1040.                    rise to potential hardware conflicts and lost
  1041.                    data.
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.                                       Page 16
  1055.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1056.  
  1057.  
  1058.  
  1059.  
  1060.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1061.                              for Microsoft and Turbo C
  1062.  
  1063.                 2. Does the hardware permit  re-assignment of the
  1064.                    IRQ priority. Some expansion cards permit you to
  1065.                    alter the IRQ priority, some won't. Suffice it
  1066.                    to say from the previous discussion the any
  1067.                    change to the IRQ priority must allow a
  1068.                    corresponding change to the interrupt vector
  1069.                    number. Without this capability, reprogramming
  1070.                    of the 8259 chip would be required.
  1071.  
  1072.  
  1073.                 3. In fact, many add-on cards permit this dual
  1074.                    change simply by making a single switch or
  1075.                    jumper setting. Unfortunately, the documentation
  1076.                    for these cards  generally assume that you are
  1077.                    aware of the dual nature of the IRQ vector
  1078.                    relationship, and may leave you with the
  1079.                    impression that you are changing one and not the
  1080.                    other. In most circumstances, this is not the
  1081.                    case.
  1082.  
  1083.             The point to all of this is that LiteComm can only provide
  1084.             as much support as the hardware permits, or is capable of
  1085.             responding to. If you wish to use other than the default
  1086.             base port, interrupt vector, or irq priority for COM3 or
  1087.             COM4, then your expansion card must be capable of supporting
  1088.             the new values; in other words, these values are all
  1089.             hardware-provided, and are recognized by the LiteComm
  1090.             software. If your hardware does not permit changing a value,
  1091.             LiteComm cannot improve the situation.
  1092.  
  1093.  
  1094.             We should, at this point, add one final caution about how
  1095.             interrupt priorities function, and their relationship to the
  1096.             irq bit the you may select. The standard PC permits 8
  1097.             interrupt priority levels, with the programmable timer
  1098.             having the highest priority, and the parallel printer port
  1099.             having the lowest priority. When an interrupt occurs, the
  1100.             interrupt controller (8259 chip) masks out all other
  1101.             interrupts from the priority of the interrupting device and
  1102.             all lower priority devices.
  1103.  
  1104.  
  1105.             As an aid to making COM3 and COM4 "fit", LiteComm supports
  1106.             interrupt chaining for the COM3 and COM4 ports. If you use
  1107.             COM3 or COM4, when an interrupt occurs, the kernel will
  1108.             attempt to determine if the interrupt was caused by the
  1109.             supported port or from some other source.
  1110.  
  1111.  
  1112.             If the kernel determines that the supported port did not
  1113.             cause the interrupt, an automatic chain to the original
  1114.             interrupt handler for that interrupt level (IRQ level) will
  1115.             take place, allowing you to "patch in" or share the
  1116.             available interrupt vectors.
  1117.  
  1118.  
  1119.  
  1120.                                       Page 17
  1121.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1122.  
  1123.  
  1124.  
  1125.  
  1126.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1127.                              for Microsoft and Turbo C
  1128.  
  1129.             If you intend to use other than the library-provided
  1130.             defaults, be sure that you understand the interrupt
  1131.             mechanism. The use of the automatic chaining described above
  1132.             can be particularly troublesome under some circumstances,
  1133.             resulting in loss of interrupts and, potentially, a system
  1134.             crash.
  1135.  
  1136.  
  1137.             DO NOT attempt to mix the ToolBox functions with other
  1138.             seemingly-related functions (such as the BIOS calls provided
  1139.             in both Turbo and Microsoft C).  At least two users have
  1140.             attempted to only use the receive-portions of LiteComm,
  1141.             while resorting to the BIOS functions to send characters.
  1142.             The result at best has been failure of the user's
  1143.             application to function, and, at worst, total system
  1144.             lockups.  This mix of functions is NOT supported and must
  1145.             not be used.  If you attempt such a mix, we cannot help you.
  1146.  
  1147.  
  1148.             One final caution is in order.  One or two users have
  1149.             attempted to trace through the interrupts as they occur
  1150.             using debuggers.  This is a risky proposition at best since
  1151.             most debuggers work by tapping into, and disturbing, the
  1152.             interrupt mechanism.  If you feel you must use a debugger,
  1153.             try to stay away from the kernel routines of LiteComm, or
  1154.             use a hardware-based debugger such as Periscope.
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.                                       Page 18
  1187.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1188.  
  1189.  
  1190.  
  1191.  
  1192.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1193.                              for Microsoft and Turbo C
  1194.  
  1195.                                   PACKAGE CONTENTS                                  PACKAGE CONTENTS                                  ________________
  1196.  
  1197.             Your distribution diskette contains several files that are
  1198.             important to you. All distribution diskettes, at a minimum,
  1199.             include the following files in the diskette's root
  1200.             directory:
  1201.  
  1202.             
  1203.             .fo off
  1204.                    LSERIAL.NUM       SERIAL NUMBER OF THIS COPY
  1205.                    READ.ME           LATEST INFORMATION ABOUT LITECOMM
  1206.             
  1207.                    TCOMM.ARC         SHAREWARE VERSION AND DOCUMENTATION
  1208.                                      FILES - TURBO C VERSION
  1209.             
  1210.                    MCOMM.ARC         SHAREWARE VERSION AND DOCUMENTATION
  1211.                                      FILES - MICROSOFT C VERSION
  1212.             
  1213.                    TCLIB.ARC         ALL MODEL LIBRARIES FOR TURBO C
  1214.             
  1215.                    MSCLIB.ARC        ALL MODEL LIBRARIES FOR MICROSOFT C
  1216.  
  1217.             If you registered for the source code modules, the diskette
  1218.             contains a sub directory called SOURCE.  The SOURCE
  1219.             directory contains 2 source code archives, as well as
  1220.             several compiler specific archives.
  1221.  
  1222.             
  1223.             
  1224.                    LITECOMM SOURCE CODE       LCSRC.ARC
  1225.             
  1226.                    XMODEM ENGINE SOURCE CODE  LXMSRC.ARC
  1227.             
  1228.                    COMPILER SPECIFIC FILES    MSC.ARC
  1229.                                               TURBOC.ARC
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.                                       Page 19
  1253.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1254.  
  1255.  
  1256.  
  1257.  
  1258.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1259.                              for Microsoft and Turbo C
  1260.  
  1261.                            COMPILER-SPECIFIC INSTRUCTIONS                           COMPILER-SPECIFIC INSTRUCTIONS                           ______________________________
  1262.  
  1263.  
  1264.             INSTALLING THE TURBO C VERSION            INSTALLING THE TURBO C VERSION            ______________________________
  1265.  
  1266.  
  1267.             In the following discussion, we assume that your regular            ________________________________________________________
  1268.             Turbo header files are contained in a directory called            ______________________________________________________
  1269.             \TC\INCLUDE, and that your Turbo libraries are in a            \TC\INCLUDE                                                    ___________________________________________________
  1270.             directory called \TC\LIB, as recommended by Borland.                             \TC\LIB                                        ____________________________________________________
  1271.  
  1272.  
  1273.             To install the header files used with LiteComm, perform the
  1274.             following steps:
  1275.  
  1276.  
  1277.  
  1278.                 1. CD \TC\INCLUDE
  1279.  
  1280.  
  1281.                 2. ARC E A:TCOMM *.H
  1282.  
  1283.  
  1284.                 3. ARC E A:TCLIB *.H
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.                                       Page 20
  1319.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1320.  
  1321.  
  1322.  
  1323.  
  1324.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1325.                              for Microsoft and Turbo C
  1326.  
  1327.             To install the library files, perform the following steps:
  1328.  
  1329.  
  1330.  
  1331.                 1. CD \TC\LIB
  1332.  
  1333.  
  1334.                 2. ARC E A:TCLIB *.LIB
  1335.  
  1336.             If you are installing only the libraries, this completes the
  1337.             installation procedure for Turbo C. If you have registered
  1338.             for the package's source code, we recommend that you create
  1339.             two subdirectories named COMM and PROTO to hold the LiteComm
  1340.             and XModem source code respectively. To install the LiteComm
  1341.             source code, do the following:
  1342.  
  1343.  
  1344.  
  1345.                 1. MD \COMM
  1346.  
  1347.  
  1348.                 2. CD \COMM
  1349.  
  1350.  
  1351.                 3. ARC E A:LCSRC *.*
  1352.  
  1353.             To install the XModem source code, do the following:
  1354.  
  1355.  
  1356.  
  1357.                 1. MD \PROTO
  1358.  
  1359.  
  1360.                 2. CD \PROTO
  1361.  
  1362.  
  1363.                 3. ARC E A:LXMSRC *.*
  1364.  
  1365.             We strongly urge that you use the recommended approach in
  1366.             handling the source code to avoid naming conflicts that
  1367.             might arise.
  1368.  
  1369.  
  1370.             It is important to source code registrants to be aware that
  1371.             to successfully rebuild the LiteComm or XModem libraries,
  1372.             the supplied make files assume that you are using Turbo-C
  1373.             version 1.5, and therefore have access to the TLIB program
  1374.             that is a part of Version 1.5.  If you are using version 1.0
  1375.             of Turbo-C, you must have access to LIB.EXE, the MicroSoft
  1376.             Librarian program, or a suitable replacement. To use the
  1377.             make files included in the package under these
  1378.             circumstances, you will have to change the make files
  1379.             accordingly to refer to LIB rather than TLIB.
  1380.  
  1381.  
  1382.  
  1383.  
  1384.                                       Page 21
  1385.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1386.  
  1387.  
  1388.  
  1389.  
  1390.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1391.                              for Microsoft and Turbo C
  1392.  
  1393.             Turbo C users must also be aware of several additional
  1394.             facts. One module, ichain, is written in assembly code.To
  1395.             reassemble this module, you must have access to MicroSoft
  1396.             MASM, Version 5.0 or greater. The object version of ichain
  1397.             is in the TURBOC.ARC file.
  1398.  
  1399.  
  1400.             When you specify the use of the LiteComm and XModem Engine
  1401.             libraries in Turbo C, you must fully qualify the library
  1402.             name in your .PRJ file, even if you have specified the
  1403.             default library directory in the TC Option. The library
  1404.             option tells TC how to look for the standard Turbo C
  1405.             libraries, but not any user-provided libraries.
  1406.  
  1407.  
  1408.  
  1409.             INSTALLING THE MICROSOFT C VERSION            INSTALLING THE MICROSOFT C VERSION            __________________________________
  1410.  
  1411.  
  1412.             In the following discussion, we assume that your regular            ________________________________________________________
  1413.             header files are contained in a sub-directory called            ____________________________________________________
  1414.             INCLUDE, and that your libraries are in a sub-directory            INCLUDE                                                            _______________________________________________________
  1415.             called LIB, as recommended by Microsoft. These instructions                   LIB                                                             ___________________________________________________________
  1416.             pertain to both Microsoft QuickC and standard C.            ________________________________________________
  1417.  
  1418.  
  1419.             To install the header files used with LiteComm, perform the
  1420.             following steps:
  1421.  
  1422.  
  1423.  
  1424.                 1. CD INCLUDE
  1425.  
  1426.  
  1427.                 2. ARC E A:MCOMM *.H
  1428.  
  1429.  
  1430.                 3. ARC E A:MCLIB *.H
  1431.  
  1432.             To install the library files, perform the following steps:
  1433.  
  1434.  
  1435.  
  1436.                 1. CD LIB
  1437.  
  1438.  
  1439.                 2. ARC E A:MCLIB *.LIB
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.                                       Page 22
  1451.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1452.  
  1453.  
  1454.  
  1455.  
  1456.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1457.                              for Microsoft and Turbo C
  1458.  
  1459.             If you are installing only the libraries, this completes the
  1460.             installation procedure for Microsoft C. If you have
  1461.             registered for the package's source code, we recommend that
  1462.             you create two subdirectories named COMM and PROTO to hold
  1463.             the LiteComm and XModem source code respectively. To install
  1464.             the LiteComm source code, do the following:
  1465.  
  1466.  
  1467.  
  1468.                 1. MD COMM
  1469.  
  1470.  
  1471.                 2. CD COMM
  1472.  
  1473.  
  1474.                 3. ARC E A:LCSRC *.*
  1475.  
  1476.             To install the XModem source code, do the following:
  1477.  
  1478.  
  1479.  
  1480.                 1. MD PROTO
  1481.  
  1482.  
  1483.                 2. CD PROTO
  1484.  
  1485.  
  1486.                 3. ARC E A:LXMSRC *.*
  1487.  
  1488.             We strongly urge that you use the recommended approach in
  1489.             handling the source code to avoid naming conflicts that
  1490.             might arise.
  1491.  
  1492.  
  1493.             It is important to source code registrants to be aware that
  1494.             to successfully rebuild the LiteComm or XModem libraries,
  1495.             you must have access to a copy of LIB.EXE, the MicroSoft
  1496.             Librarian program, or a suitable replacement. To use the
  1497.             make files included in the package, LIB.EXE must either be
  1498.             in your current working directory, or in a directory
  1499.             specified in the DOS PATH variable. For additional
  1500.             information on setting the PATH variable, consult your DOS
  1501.             manual.
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.                                       Page 23
  1517.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1518.  
  1519.  
  1520.  
  1521.  
  1522.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1523.                              for Microsoft and Turbo C
  1524.  
  1525.             Microsoft C users need to know that the Microsoft C  version
  1526.             is written in, and intended to support Microsoft C version
  1527.             5.0 and QuickC.  The package has not been tested with
  1528.             earlier versions of Microsoft C.
  1529.  
  1530.  
  1531.             QuickC also note that we have NOT provided a QLB version of
  1532.             the libraries.  If you wish to create a QLB version of the
  1533.             libraries for use in the QuickC environment, follow the
  1534.             procedures outlined on pages 237-ff of the QuickC
  1535.             Programmer's Guide.  Remember, the QuickC environment
  1536.             requires the MEDIUM memory model.  Therefore, unregistered
  1537.             users cannot create a useable QLB library following this
  1538.             procedure.  Alternatively, you can use the supplied medium
  1539.             model library within the QuickC environment by specifying
  1540.             the library as part of a program list.
  1541.  
  1542.  
  1543.             Unregistered QuickC users can still use QCL to create
  1544.             useable programs with the supplied small model library.  Be
  1545.             sure to use the /AS switch when compiling.
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.                                       Page 24
  1583.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1584.  
  1585.  
  1586.  
  1587.  
  1588.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1589.                              for Microsoft and Turbo C
  1590.  
  1591.                                    GENERAL NOTES                                   GENERAL NOTES                                   _____________
  1592.  
  1593.             The LiteComm and related libraries make extensive use of
  1594.             parameters defined in the included header files. Where
  1595.             appropriate, your programs should always use the same header
  1596.             file parameters. While every effort will be made in future
  1597.             releases of LiteComm to preserve the values as currently
  1598.             provided, we cannot guarantee that changes will never
  1599.             occur.The safest way to safeguard your efforts is to use the
  1600.             defined parameters. In this way, a simple recompile and
  1601.             relink will insure consistency from one release of LiteComm
  1602.             to the next.
  1603.  
  1604.  
  1605.             In the discussion of the various functions which follow, you
  1606.             should assume that any references to the port variable refer
  1607.             to a variable or constant that may take on a value of from 1
  1608.             to 4. No other values are acceptable, and will be rejected.
  1609.  
  1610.  
  1611.             While we feel that LiteComm is written in the most efficient
  1612.             way possible, commensurate with good programming practice,
  1613.             we cannot be responsible for variations caused by hardware
  1614.             configurations or other factors beyond our control. LiteComm
  1615.             has been tested, and is known to perform on, the IBM PC-AT
  1616.             and several compatible systems such as the Zenith and Wyse
  1617.             equivalents. LiteComm has not been tested in environments in
  1618.             which other software, most significantly TSR (terminate and
  1619.             stay resident) modules exist. Some TSR programs that "steal"
  1620.             interrupts for their own purposes present an unfavorable
  1621.             environment to other programs that rely on the interrupt
  1622.             structure of the computer.
  1623.  
  1624.  
  1625.             Should you experience erratic behavior with LiteComm in a
  1626.             TSR-type situation, try executing your application without
  1627.             the TSR module being present. If the problems you have
  1628.             experienced disappear, suspect the TSR module.
  1629.  
  1630.  
  1631.             Conversely, LiteComm provides an excellent vehicle for
  1632.             supporting TSR programs that you may write. Since the
  1633.             package is fully reentrant, your only concern need be with
  1634.             those aspects of TSR programs are of normal concern, e.g.
  1635.             the non-reentrant nature of DOS. LiteComm never uses DOS
  1636.             functions and may therefore be safely used in a TSR
  1637.             environment.
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.                                       Page 25
  1649.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1650.  
  1651.  
  1652.  
  1653.  
  1654.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1655.                              for Microsoft and Turbo C
  1656.  
  1657.             Several users have reported problems in consistently
  1658.             detecting a ringing telephone by checking the state of the
  1659.             RI (Ring Indicator) signal.  The problem seems to be highly
  1660.             dependant on the type of modem that is being used, since
  1661.             this signal is provided by the modem.  If the duration of
  1662.             the signal is too short, the program may miss the signal as
  1663.             the modem toggles it on and off.  One workaround that seems
  1664.             to be satisfactory is to check the RICHG bit returned from
  1665.             lc_mstat, rather than the RI bit.  The RICHG bit will be set
  1666.             when the RI bit comes one and again when the RI bit goes
  1667.             off. This is the method employed in the new check_for_call
  1668.             function.
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.                                       Page 26
  1715.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1716.  
  1717.  
  1718.  
  1719.  
  1720.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1721.                              for Microsoft and Turbo C
  1722.  
  1723.                                  FUNCTION REFERENCE                                 FUNCTION REFERENCE                                 __________________
  1724.  
  1725.             In the following pages, we provide the detailed information
  1726.             about each of the available LiteComm ToolBox functions.
  1727.             Each function definition includes, at a minimum, a summary
  1728.             of how the function is referenced, a description of what the
  1729.             function does, and an indication of those values, if any,
  1730.             that the function might perform.
  1731.  
  1732.  
  1733.             Where appropriate, we include additional documentation about
  1734.             the function.  Some definitions include examples, in the
  1735.             sense of code fragments illustrating the function's usage.
  1736.             More importantly, some definitions include additional notes
  1737.             and warnings as well as references to other functions within
  1738.             the package.
  1739.  
  1740.  
  1741.             We have made every effort to insure that the documentation
  1742.             of the functions is complete and accurate.  The style and
  1743.             manner of the documentation assumes that the reader is
  1744.             thoroughly familiar with the elements of C syntax and common
  1745.             conventions.
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.                                       Page 27
  1781.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1782.  
  1783.  
  1784.  
  1785.  
  1786.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1787.                              for Microsoft and Turbo C
  1788.            _______________________________________________________________
  1789.  
  1790.                                       _portchg                                       portchg
  1791.            _______________________________________________________________
  1792.  
  1793.  
  1794.             SUMMARY            SUMMARY            _______
  1795.  
  1796.                  #include <litecomm.h>
  1797.                  
  1798.                  int _portchg(port, base, irq, vector)
  1799.                  
  1800.                       unsigned port;
  1801.                       unsigned base;
  1802.                       unsigned vector;
  1803.                       char irq;
  1804.  
  1805.  
  1806.             DESCRIPTION            DESCRIPTION            ___________
  1807.  
  1808.             Changes one or more of the critical parameters for COM3 or
  1809.             COM4. This function must be used before the port is opened
  1810.             to be effective. To leave any of the parameters at its
  1811.             default value, make the corresponding entry 0. Note that
  1812.             vector is a vector number, not an address or pointer.
  1813.  
  1814.  
  1815.             The irq parameter should not be taken to be the irq
  1816.             (interrupt request number, but rather the irq mask. The
  1817.             following lines, reproduced from 'litecomm.h' help
  1818.             illustrate this idea.
  1819.  
  1820.  
  1821.                  #define IRQ1 0x10 /* int req mask for port 1 -
  1822.                  irq4 */
  1823.                  #define IRQ2 0x08 /* int req mask for port 2 -
  1824.                  irq3 */
  1825.  
  1826.             Note that the value for irq4 is NOT 4, but a character in
  1827.             which bit 4, using INTEL's bit numbering, is set to a value
  1828.             of 1. Thus, to use irq priority 1 as the irq for either COM3
  1829.             or COM4, you would specify 0x02 as the value of irq when
  1830.             calling _portchg.
  1831.  
  1832.  
  1833.             The default parameters are shown in the litecomm.h include
  1834.             file.
  1835.  
  1836.  
  1837.             If you intend to change the default irq settings, you MUST
  1838.             also make a corresponding change to the vector number. See
  1839.             the accompanying documentation about using COM3 and COM4 for
  1840.             additional details. Failure to follow this rule may make the
  1841.             port appear to be non-functional.
  1842.  
  1843.  
  1844.  
  1845.  
  1846.                                       Page 28
  1847.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1848.  
  1849.  
  1850.  
  1851.  
  1852.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1853.                              for Microsoft and Turbo C
  1854.  
  1855.             The _portchg function does NOT check to determine that you
  1856.             have provided both an IRQ mask AND a new vector number.
  1857.  
  1858.  
  1859.  
  1860.             EXAMPLE            EXAMPLE            _______
  1861.  
  1862.                   if (_portchg(port, 0x408, 0, 0, 0) == -1)
  1863.                   {
  1864.                       printf("Error Changing Port %d\n", port);
  1865.                       exit(1);
  1866.                   }
  1867.  
  1868.  
  1869.             RETURN VALUES            RETURN VALUES            _____________
  1870.  
  1871.             Returns 0 if the function is successful, -1 if you attempt
  1872.             to change a port other that 3 or 4.
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.                                       Page 29
  1913.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1914.  
  1915.  
  1916.  
  1917.  
  1918.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1919.                              for Microsoft and Turbo C
  1920.            _______________________________________________________________
  1921.  
  1922.                                       comm_opn                                      comm_opn
  1923.            _______________________________________________________________
  1924.  
  1925.  
  1926.             SUMMARY            SUMMARY            _______
  1927.  
  1928.                  #include <litecomm.h>
  1929.                  
  1930.                  int comm_opn(port, baud, parity, datab, stopb,
  1931.                  inbufsz, outbufsz)
  1932.                       unsigned port;
  1933.                       unsigned baud;
  1934.                       unsigned parity;
  1935.                       unsigned datab;
  1936.                       unsigned stopb;
  1937.                       unsigned inbufsz;
  1938.                       unsigned outbufsz;
  1939.  
  1940.  
  1941.             DESCRIPTION            DESCRIPTION            ___________
  1942.  
  1943.             Opens the specified port for use and attaches an interrupt
  1944.             handler to DOS for the port. The function allocates buffers
  1945.             for input and output of the specified sizes, and sets the
  1946.             port to the parameters specified. The minimum value for
  1947.             inbufsz is 128; the minimum size for outbufsz is 64. A port
  1948.             opened in this manner must be closed using comm_close before
  1949.             program termination to avoid the possibility of a system
  1950.             crash.
  1951.  
  1952.  
  1953.             The baud parameter is an unsigned integer that specifies the
  1954.             baud rate you intend to use, e.g. 4800. The other parameters
  1955.             passed to the function should be from the parameter set in
  1956.             the litecomm.h include file.
  1957.  
  1958.  
  1959.  
  1960.             EXAMPLE            EXAMPLE            _______
  1961.  
  1962.                   if (comm_opn(port, 1200, NPARITY, BIT8, STOP1,
  1963.                  256, 256) == -1)
  1964.                  {
  1965.                       printf("Error Opening Port %d\n", port);
  1966.                       exit(1);
  1967.                  }
  1968.  
  1969.  
  1970.             RETURN VALUES            RETURN VALUES            _____________
  1971.  
  1972.             Upon successful open, the function returns port. If any
  1973.             error occurs, regardless of type, the function returns -1.
  1974.  
  1975.  
  1976.  
  1977.  
  1978.                                       Page 30
  1979.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  1980.  
  1981.  
  1982.  
  1983.  
  1984.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  1985.                              for Microsoft and Turbo C
  1986.            _______________________________________________________________
  1987.  
  1988.                                      comm_close
  1989.            _______________________________________________________________
  1990.  
  1991.  
  1992.             SUMMARY            SUMMARY            _______
  1993.  
  1994.                  #include <litecomm.h>
  1995.                  int comm_close(port)
  1996.                  unsigned port;
  1997.  
  1998.  
  1999.             DESCRIPTION            DESCRIPTION            ___________
  2000.  
  2001.             This function is the companion to comm_opn and, in effect,
  2002.             performs the opposite action. Comm_close detaches the
  2003.             library routines from the interrupt handler, and reconnects
  2004.             the previous interrupt handler. Comm_close also release
  2005.             dynamically allocated member used for buffering and control
  2006.             structures. Failure to call comm_close before terminating a
  2007.             program may result in unexplained system crashes or hangs.
  2008.  
  2009.  
  2010.  
  2011.             RETURN VALUES            RETURN VALUES            _____________
  2012.  
  2013.             If any error occurs, regardless of type, the function
  2014.             returns -1.
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.                                       Page 31
  2045.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2046.  
  2047.  
  2048.  
  2049.  
  2050.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2051.                              for Microsoft and Turbo C
  2052.            _______________________________________________________________
  2053.  
  2054.                                      comm_setup
  2055.            _______________________________________________________________
  2056.  
  2057.  
  2058.             SUMMARY            SUMMARY            _______
  2059.  
  2060.                  #include <litecomm.h>
  2061.                  
  2062.                  int comm_setup(port,baud,parity,datab,stopb)
  2063.                  
  2064.                       unsigned port;
  2065.                       unsigned baud;
  2066.                       unsigned parity;
  2067.                       unsigned datab;
  2068.                       unsigned stopb;
  2069.  
  2070.  
  2071.             DESCRIPTION            DESCRIPTION            ___________
  2072.  
  2073.             The comm_setup function is a subset of the comm_opn function
  2074.             and the remarks made in the description of comm_opn apply.
  2075.             This function is useful if you wish to change the basic
  2076.             communication parameters of the specified port that has
  2077.             already been opened without comm_close'ing the port and
  2078.             breaking the telephone connection.
  2079.  
  2080.  
  2081.  
  2082.             EXAMPLE            EXAMPLE            _______
  2083.  
  2084.                  if (comm_setup(port, 1200, NPARITY, BIT8, STOP1)
  2085.                  == -1)
  2086.                  {
  2087.                       printf("Error Changing Port %d\n", port);
  2088.                       exit(1);
  2089.                  }
  2090.  
  2091.  
  2092.             RETURN VALUES            RETURN VALUES            _____________
  2093.  
  2094.             If any error occurs, regardless of type, the function
  2095.             returns -1.
  2096.  
  2097.  
  2098.  
  2099.             SEE ALSO            SEE ALSO            ________
  2100.                  comm_opn
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.                                       Page 32
  2111.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2112.  
  2113.  
  2114.  
  2115.  
  2116.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2117.                              for Microsoft and Turbo C
  2118.            _______________________________________________________________
  2119.  
  2120.                                       lc_vport
  2121.            _______________________________________________________________
  2122.  
  2123.  
  2124.             SUMMARY            SUMMARY            _______
  2125.  
  2126.                  #include <litecomm.h>
  2127.                  
  2128.                  COMM *lc_vport(port)
  2129.                  
  2130.                       unsigned port;
  2131.  
  2132.  
  2133.             DESCRIPTION            DESCRIPTION            ___________
  2134.  
  2135.             Used internally to validate that the port number specified
  2136.             is correct and has been opened with the comm_opn function.
  2137.             May be of use to you in writing certain applications.
  2138.  
  2139.  
  2140.  
  2141.             RETURN VALUES            RETURN VALUES            _____________
  2142.  
  2143.             If the port is valid and has been opened, returns a pointer
  2144.             to the control block for the port. Returns NULL if an error
  2145.             occurs;
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.                                       Page 33
  2177.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2178.  
  2179.  
  2180.  
  2181.  
  2182.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2183.                              for Microsoft and Turbo C
  2184.            _______________________________________________________________
  2185.  
  2186.                                       lc_icnt
  2187.            _______________________________________________________________
  2188.  
  2189.  
  2190.             SUMMARY            SUMMARY            _______
  2191.  
  2192.                  #include <litecomm.h>
  2193.                  
  2194.                  int lc_icnt(port)
  2195.                  int lc_ocnt(port)
  2196.                  
  2197.                       unsigned port;
  2198.  
  2199.  
  2200.             DESCRIPTION            DESCRIPTION            ___________
  2201.  
  2202.             May be used to determine the number of characters currently
  2203.             in the input(lc_icnt) or output(lc_ocnt) buffers for the
  2204.             port.
  2205.  
  2206.  
  2207.  
  2208.             RETURN VALUES            RETURN VALUES            _____________
  2209.  
  2210.             Both functions return -1 if an error occurs (port not open
  2211.             or invalid port number).The lc_icnt() function return the
  2212.             number of characters in the input buffer; lc_ocnt() returns
  2213.             the number of characters in the transmit buffer that have
  2214.             not been sent.
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.                                       Page 34
  2243.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2244.  
  2245.  
  2246.  
  2247.  
  2248.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2249.                              for Microsoft and Turbo C
  2250.            _______________________________________________________________
  2251.  
  2252.                                       lc_mstat
  2253.            _______________________________________________________________
  2254.  
  2255.  
  2256.             SUMMARY            SUMMARY            _______
  2257.  
  2258.                  #include <litecomm.h>
  2259.                  
  2260.                  int lc_mstat(port)
  2261.                  
  2262.                       unsigned port;
  2263.  
  2264.  
  2265.             DESCRIPTION            DESCRIPTION            ___________
  2266.  
  2267.             May be used to determine the last known state of the modem-
  2268.             supplied handshake signals. These may be tested using the
  2269.             values in the include'd litecomm.h file. The handshake
  2270.             signals consist of a byte in which the bits 4-7 contain the
  2271.             current state of the signals (such as Clear To Send or CTS)
  2272.             and bits 0-3 contain information regarding whether or not
  2273.             individual signals have changed.  lc_mstat always returns
  2274.             the current values of signals in bits 4-7.  Bits 0-3 will
  2275.             reflect which, if any, of the signals has changed.  The
  2276.             easiest approach to dealing with the returned value is to
  2277.             test bits 0-3 for a non-zero value.  If any non-zero value
  2278.             is returned, one or more signals have changed since the last
  2279.             call to lc_mstat.  NOTE: You should be aware that the bits
  2280.             0-3 are reset once this function is called.  The value
  2281.             obtained from bits 4-7 will correctly reflect the current
  2282.             state of the signals.
  2283.  
  2284.  
  2285.             To determine which signals, if any, have changed use the
  2286.             XXXCHG bits returned (see litecomm.h).
  2287.  
  2288.  
  2289.  
  2290.             RETURN VALUES            RETURN VALUES            _____________
  2291.  
  2292.             If the port is valid and has been opened, returns the
  2293.             current modem status bits. Returns -1 if an error occurs.
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.                                       Page 35
  2309.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2310.  
  2311.  
  2312.  
  2313.  
  2314.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2315.                              for Microsoft and Turbo C
  2316.            _______________________________________________________________
  2317.  
  2318.                                       lc_estat
  2319.            _______________________________________________________________
  2320.  
  2321.  
  2322.             SUMMARY            SUMMARY            _______
  2323.  
  2324.                  #include <litecomm.h>
  2325.                  
  2326.                  int lc_estat(port)
  2327.                  
  2328.                       unsigned port;
  2329.  
  2330.  
  2331.             DESCRIPTION            DESCRIPTION            ___________
  2332.  
  2333.             May be used to determine the last known state of the serial
  2334.             port's error status bits. These may be tested using the
  2335.             values in the include'd litecomm.h file.
  2336.  
  2337.  
  2338.  
  2339.             RETURN VALUES            RETURN VALUES            _____________
  2340.  
  2341.             If the port is valid and has been opened, returns the
  2342.             current error status bits. Returns -1 if an error occurs.
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.                                       Page 36
  2375.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2376.  
  2377.  
  2378.  
  2379.  
  2380.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2381.                              for Microsoft and Turbo C
  2382.            _______________________________________________________________
  2383.  
  2384.                                       lc_getw
  2385.            _______________________________________________________________
  2386.  
  2387.  
  2388.             SUMMARY            SUMMARY            _______
  2389.  
  2390.                  #include <litecomm.h>
  2391.                  
  2392.                  int lc_getw(port)
  2393.                  
  2394.                       unsigned port;
  2395.  
  2396.  
  2397.             DESCRIPTION            DESCRIPTION            ___________
  2398.  
  2399.             Read a character from the serial port's input buffer. Wait
  2400.             indefinitely until a character is available.
  2401.  
  2402.  
  2403.  
  2404.             RETURN VALUES            RETURN VALUES            _____________
  2405.  
  2406.             Returns the next available character in the input buffer for
  2407.             the port. Returns -1 if the port is not active.
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.                                       Page 37
  2441.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2442.  
  2443.  
  2444.  
  2445.  
  2446.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2447.                              for Microsoft and Turbo C
  2448.            _______________________________________________________________
  2449.  
  2450.                                      lc_setmdm
  2451.            _______________________________________________________________
  2452.  
  2453.  
  2454.             SUMMARY            SUMMARY            _______
  2455.  
  2456.                  #include <litecomm.h>
  2457.                  
  2458.                  int lc_setmdm(port, newset)
  2459.                  
  2460.                       unsigned port;
  2461.                       unsigned newset;
  2462.  
  2463.  
  2464.             DESCRIPTION            DESCRIPTION            ___________
  2465.  
  2466.             Set one or more of the modem control signals. Because of the
  2467.             need to always have OUT2 set for interrupt support, the
  2468.             function always provides the correct setting for this bit.
  2469.             Use the mask values found in the include file.
  2470.  
  2471.  
  2472.  
  2473.             RETURN VALUES            RETURN VALUES            _____________
  2474.  
  2475.             Returns 0 if the operation was successful, returns -1
  2476.             otherwise.
  2477.  
  2478.  
  2479.  
  2480.             SEE ALSO            SEE ALSO            ________
  2481.                  lc_clrmdm, lc_togmdm
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.                                       Page 38
  2507.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2508.  
  2509.  
  2510.  
  2511.  
  2512.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2513.                              for Microsoft and Turbo C
  2514.            _______________________________________________________________
  2515.  
  2516.                                      lc_clrmdm
  2517.            _______________________________________________________________
  2518.  
  2519.  
  2520.             SUMMARY            SUMMARY            _______
  2521.  
  2522.                  #include <litecomm.h>
  2523.                  
  2524.                  int lc_clrmdm(port, newset)
  2525.                  
  2526.                       unsigned port;
  2527.                       unsigned newset;
  2528.  
  2529.  
  2530.             DESCRIPTION            DESCRIPTION            ___________
  2531.  
  2532.             Companion to setmdm function. Clears one or more of the
  2533.             modem control signals. Because of the need to always have
  2534.             OUT2 set for interrupt support, the function always provides
  2535.             the correct setting for this bit. Use the mask values found
  2536.             in the include file.
  2537.  
  2538.  
  2539.  
  2540.             RETURN VALUES            RETURN VALUES            _____________
  2541.  
  2542.             Returns 0 if the operation was successful, returns -1
  2543.             otherwise.
  2544.  
  2545.  
  2546.  
  2547.             SEE ALSO            SEE ALSO            ________
  2548.                  lc_setmdm, lc_togmdm
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.                                       Page 39
  2573.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2574.  
  2575.  
  2576.  
  2577.  
  2578.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2579.                              for Microsoft and Turbo C
  2580.            _______________________________________________________________
  2581.  
  2582.                                      lc_togmdm
  2583.            _______________________________________________________________
  2584.  
  2585.  
  2586.             SUMMARY            SUMMARY            _______
  2587.  
  2588.                  #include <litecomm.h>
  2589.                  
  2590.                  int lc_togmdm(port, newset)
  2591.                  
  2592.                       unsigned port;
  2593.                       unsigned newset;
  2594.  
  2595.  
  2596.             DESCRIPTION            DESCRIPTION            ___________
  2597.  
  2598.             Companion to setmdm function. Flip-flops one or more of the
  2599.             modem control signals. Because of the need to always have
  2600.             OUT2 set for interrupt support, the function always provides
  2601.             the correct setting for this bit. Use the mask values found
  2602.             in the include file.
  2603.  
  2604.  
  2605.  
  2606.             RETURN VALUES            RETURN VALUES            _____________
  2607.  
  2608.             Returns 0 if the operation was successful, returns -1
  2609.             otherwise.
  2610.  
  2611.  
  2612.  
  2613.             SEE ALSO            SEE ALSO            ________
  2614.                  lc_setmdm, lc_clrmdm
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.                                       Page 40
  2639.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2640.  
  2641.  
  2642.  
  2643.  
  2644.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2645.                              for Microsoft and Turbo C
  2646.            _______________________________________________________________
  2647.  
  2648.                                       lc_xoff
  2649.            _______________________________________________________________
  2650.  
  2651.  
  2652.             SUMMARY            SUMMARY            _______
  2653.  
  2654.                  #include <litecomm.h>
  2655.                  
  2656.                  int lc_xoff(port, flag)
  2657.                  
  2658.                       unsigned port;
  2659.                       BOOL flag; /* #define BOOL int */
  2660.  
  2661.  
  2662.             DESCRIPTION            DESCRIPTION            ___________
  2663.  
  2664.             If flag is TRUE, turns on semi-automatic XON-XOFF flow
  2665.             control function. If flag is FALSE (the default setting),
  2666.             automatic flow control is disabled. When enabled, the kernel
  2667.             will automatically transmit an XOFF if and when the input
  2668.             buffer is approximately 2/3 full and will automatically
  2669.             recognize an XOFF sent by the companion system. If the
  2670.             companion system transmits an XOFF, the kernel will refuse
  2671.             to send any characters until the condition is cleared.
  2672.  
  2673.  
  2674.             It is the programmer's responsibility to transmit XON when
  2675.             conditions permit. See the lc_putxoff function to tell if an
  2676.             automatic XOFF has been sent by the kernel. See the
  2677.             lc_gotxoff function to determine if the kernel has detected
  2678.             an XOFF.
  2679.  
  2680.  
  2681.             If you intended to implement a protocol that might include
  2682.             the XON-XOFF characters, be sure to disable the automatic
  2683.             flow control. Failure to do so may result in a system hang.
  2684.  
  2685.  
  2686.  
  2687.             RETURN VALUES            RETURN VALUES            _____________
  2688.  
  2689.             Returns 0 if the operation was successful, returns -1
  2690.             otherwise.
  2691.  
  2692.  
  2693.  
  2694.             SEE ALSO            SEE ALSO            ________
  2695.                  lc_gotxoff, lc_putxoff
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.                                       Page 41
  2705.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2706.  
  2707.  
  2708.  
  2709.  
  2710.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2711.                              for Microsoft and Turbo C
  2712.            _______________________________________________________________
  2713.  
  2714.                                      lc_gotxoff
  2715.            _______________________________________________________________
  2716.  
  2717.  
  2718.             SUMMARY            SUMMARY            _______
  2719.  
  2720.                  #include <litecomm.h>
  2721.                  
  2722.                  BOOL lc_gotxoff(port)
  2723.                  
  2724.                       unsigned port;
  2725.                       /* #define BOOL int */
  2726.  
  2727.  
  2728.             DESCRIPTION            DESCRIPTION            ___________
  2729.  
  2730.             See below for the values returned. If an XOFF has been
  2731.             received, the port's flag will be reset, and transmission to
  2732.             the companion system will be permitted. If an XON is
  2733.             received from the companion system, the port's flag will
  2734.             also be reset, permitting further transmissions to occur. Be
  2735.             aware that if the companion system never sends an XON after
  2736.             sending an XOFF, a possible race condition may occur,                                        race                                                             ____                     
  2737.             resulting in a system hang.
  2738.  
  2739.  
  2740.  
  2741.             RETURN VALUES            RETURN VALUES            _____________
  2742.  
  2743.             Returns TRUE if an XOFF was detected, FALSE if an XOFF was
  2744.             not detected. Will return -1 in the case of an error.
  2745.  
  2746.  
  2747.  
  2748.             SEE ALSO            SEE ALSO            ________
  2749.                  lc_xoff, lc_putxoff
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.                                       Page 42
  2771.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2772.  
  2773.  
  2774.  
  2775.  
  2776.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2777.                              for Microsoft and Turbo C
  2778.            _______________________________________________________________
  2779.  
  2780.                                      lc_putxoff
  2781.            _______________________________________________________________
  2782.  
  2783.  
  2784.             SUMMARY            SUMMARY            _______
  2785.  
  2786.                  #include <litecomm.h>
  2787.                  
  2788.                  BOOL lc_putxoff(port)
  2789.                  
  2790.                       unsigned port;
  2791.                       /* #define BOOL int */
  2792.  
  2793.  
  2794.             DESCRIPTION            DESCRIPTION            ___________
  2795.  
  2796.             See below for the values returned. If an XOFF has been sent,
  2797.             the port's flag will be reset. Use this function in concert
  2798.             with transmission of an XON character to the companion
  2799.             system to permit transmissions to proceed.
  2800.  
  2801.  
  2802.  
  2803.             RETURN VALUES            RETURN VALUES            _____________
  2804.  
  2805.             Returns TRUE if XOFF was sent to the companion system, FALSE
  2806.             if XOFF not sent since the last time the function was
  2807.             called. Will return -1 in the case of an error.
  2808.  
  2809.  
  2810.  
  2811.             SEE ALSO            SEE ALSO            ________
  2812.                  lc_xoff, lc_putxoff
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.                                       Page 43
  2837.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2838.  
  2839.  
  2840.  
  2841.  
  2842.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2843.                              for Microsoft and Turbo C
  2844.            _______________________________________________________________
  2845.  
  2846.                                        lc_get
  2847.            _______________________________________________________________
  2848.  
  2849.  
  2850.             SUMMARY            SUMMARY            _______
  2851.  
  2852.                  #include <litecomm.h>
  2853.                  int lc_get(port)
  2854.                  
  2855.                       unsigned port;
  2856.  
  2857.  
  2858.             DESCRIPTION            DESCRIPTION            ___________
  2859.  
  2860.             Read a character from the serial port's input buffer.
  2861.  
  2862.  
  2863.  
  2864.             RETURN VALUES            RETURN VALUES            _____________
  2865.  
  2866.             Returns the next available character in the input buffer for
  2867.             the port. Returns -1 if the port is not active, or if there
  2868.             are not characters in the port's buffer.
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.                                       Page 44
  2903.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2904.  
  2905.  
  2906.  
  2907.  
  2908.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2909.                              for Microsoft and Turbo C
  2910.            _______________________________________________________________
  2911.  
  2912.                                       lc_peek
  2913.            _______________________________________________________________
  2914.  
  2915.  
  2916.             SUMMARY            SUMMARY            _______
  2917.  
  2918.                  #include <litecomm.h>
  2919.                  
  2920.                  int lc_peek(port)
  2921.                  
  2922.                       unsigned port;
  2923.  
  2924.  
  2925.             DESCRIPTION            DESCRIPTION            ___________
  2926.  
  2927.             Look at the next character in the serial port's input
  2928.             buffer.
  2929.  
  2930.  
  2931.  
  2932.             RETURN VALUES            RETURN VALUES            _____________
  2933.  
  2934.             Returns the next available character in the input buffer for
  2935.             the port, but does not remove the character from the buffer.
  2936.             This allows the application to look-ahead by one character                                           look-ahead                                                            __________                 
  2937.             in a non-destructive fashion. Returns -1 if the port is not
  2938.             active, or if there are no characters in the port's buffer.
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.                                       Page 45
  2969.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  2970.  
  2971.  
  2972.  
  2973.  
  2974.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  2975.                              for Microsoft and Turbo C
  2976.            _______________________________________________________________
  2977.  
  2978.                                        lc_put
  2979.            _______________________________________________________________
  2980.  
  2981.  
  2982.             SUMMARY            SUMMARY            _______
  2983.  
  2984.                  #include <litecomm.h>
  2985.                  
  2986.                  int lc_put(port,ch)
  2987.                  
  2988.                       unsigned port;
  2989.                       char ch;
  2990.  
  2991.  
  2992.             DESCRIPTION            DESCRIPTION            ___________
  2993.  
  2994.             Place a character into the serial port's output buffer.
  2995.  
  2996.  
  2997.  
  2998.             RETURN VALUES            RETURN VALUES            _____________
  2999.  
  3000.             Returns 0 if successful. Note that this does not guarantee
  3001.             that the character has been sent, only that no errors were
  3002.             detected. Returns -1 if the port is not active, or if there
  3003.             no room in the port's buffer.
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.                                       Page 46
  3035.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3036.  
  3037.  
  3038.  
  3039.  
  3040.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3041.                              for Microsoft and Turbo C
  3042.            _______________________________________________________________
  3043.  
  3044.                                       lc_gets
  3045.            _______________________________________________________________
  3046.  
  3047.  
  3048.             SUMMARY            SUMMARY            _______
  3049.  
  3050.                  #include <litecomm.h>
  3051.                  
  3052.                  int lc_gets(port, buff, cnt)
  3053.                  
  3054.                       unsigned port;
  3055.                       char *buff;
  3056.                       int cnt;
  3057.  
  3058.  
  3059.             DESCRIPTION            DESCRIPTION            ___________
  3060.  
  3061.             Read a stream of, at most, cnt characters from the serial
  3062.             port's input buffer into the buff location. Not sensitive to
  3063.             NULL character.
  3064.  
  3065.  
  3066.  
  3067.             RETURN VALUES            RETURN VALUES            _____________
  3068.  
  3069.              Returns the count of characters actually transferred, or -1
  3070.             if an error occurs.
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.                                       Page 47
  3101.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3102.  
  3103.  
  3104.  
  3105.  
  3106.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3107.                              for Microsoft and Turbo C
  3108.            _______________________________________________________________
  3109.  
  3110.                                       lc_puts
  3111.            _______________________________________________________________
  3112.  
  3113.  
  3114.             SUMMARY            SUMMARY            _______
  3115.  
  3116.                  #include <litecomm.h>
  3117.                  int lc_puts(port, buff, cnt)
  3118.                  
  3119.                       unsigned port;
  3120.                       char *buff;
  3121.                       int cnt;
  3122.  
  3123.  
  3124.             DESCRIPTION            DESCRIPTION            ___________
  3125.  
  3126.             Place a stream of, at most,cnt characters into the serial                                       cnt                                                                  ___                           
  3127.             port's output buffer.
  3128.  
  3129.  
  3130.  
  3131.             RETURN VALUES            RETURN VALUES            _____________
  3132.  
  3133.             Returns the number of characters actually placed into the
  3134.             buffer. Note that this does not guarantee that the
  3135.             characters have been sent. Returns 0 if any error occurs, or
  3136.             if there no room in the port's buffer.
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.                                       Page 48
  3167.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3168.  
  3169.  
  3170.  
  3171.  
  3172.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3173.                              for Microsoft and Turbo C
  3174.            _______________________________________________________________
  3175.  
  3176.                                       lc_flush
  3177.            _______________________________________________________________
  3178.  
  3179.  
  3180.             SUMMARY            SUMMARY            _______
  3181.  
  3182.                  #include <litecomm.h>
  3183.                  
  3184.                  int lc_tflush(port)
  3185.                  
  3186.                  int lc_rflush(port)
  3187.                  
  3188.                  int lc_flshtrue(port, ch)
  3189.                  
  3190.                  int lc_nflush(port, cnt)
  3191.                  
  3192.                       unsigned port;
  3193.                       char ch;
  3194.                       int cnt;
  3195.  
  3196.  
  3197.             DESCRIPTION            DESCRIPTION            ___________
  3198.  
  3199.             The <?>flush functions remove characters from the specified
  3200.             buffer and discard them; untransmitted characters in the
  3201.             transmit buffer are NEVER sent; unprocessed characters in
  3202.             the receive buffer are lost.
  3203.  
  3204.  
  3205.             lc_tflush empties the port's transmit buffer immediately.
  3206.  
  3207.  
  3208.             lc_rflush empties the port's receive buffer immediately.
  3209.  
  3210.  
  3211.             lc_flshtrue will continually dispose of received characters
  3212.             until the character ch is received. Use caution with this
  3213.             one since it does not detect port number errors.
  3214.  
  3215.  
  3216.             lc_nflush flushes, at most, cnt characters from the port's
  3217.             receive buffer.
  3218.  
  3219.  
  3220.  
  3221.             RETURN VALUES            RETURN VALUES            _____________
  3222.  
  3223.             lc_flshtrue returns no values. lc_tflush and lc_rflush
  3224.             return 0 if successful and -1 if an error occurs. lc_nflush
  3225.             returns the number of characters actually flushed from the
  3226.             receive buffer or 0 in the case of no characters to flush,
  3227.             or if an error was detected an error.
  3228.  
  3229.  
  3230.  
  3231.  
  3232.                                       Page 49
  3233.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3234.  
  3235.  
  3236.  
  3237.  
  3238.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3239.                              for Microsoft and Turbo C
  3240.            _______________________________________________________________
  3241.  
  3242.                                       lc_sbrk
  3243.            _______________________________________________________________
  3244.  
  3245.  
  3246.             SUMMARY            SUMMARY            _______
  3247.  
  3248.                  #include <litecomm.h>
  3249.                  
  3250.                  int lc_sbrk(port)
  3251.                  lc_gotbrk(port)
  3252.                  
  3253.                       unsigned port;
  3254.  
  3255.  
  3256.             DESCRIPTION            DESCRIPTION            ___________
  3257.  
  3258.             lc_sbrk() generates a BREAK signal using a particular
  3259.             characteristic of the 8250 UART to generate a more accurate
  3260.             BREAK at any baud rate.  BREAKS generated in this manner are
  3261.             timed based upon the baud rate at which the 8250 is
  3262.             currently initialized.  This function may or may not work
  3263.             correctly with other than the actual 8250 UART.
  3264.  
  3265.  
  3266.             lc_gotbrk returns TRUE if a break signal has been received
  3267.             on the specified port.  It returns FALSE otherwise.
  3268.  
  3269.  
  3270.  
  3271.             RETURN VALUES            RETURN VALUES            _____________
  3272.  
  3273.             Returns 0 if successful. Returns -1 if the port is not
  3274.             active.
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.                                       Page 50
  3299.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3300.  
  3301.  
  3302.  
  3303.  
  3304.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3305.                              for Microsoft and Turbo C
  3306.            _______________________________________________________________
  3307.  
  3308.                                BBS SUPPORT FUNCTIONS
  3309.            _______________________________________________________________
  3310.  
  3311.  
  3312.             INTRODUCTION            INTRODUCTION            ____________
  3313.  
  3314.  
  3315.             In this section, we discuss a set of utility functions that
  3316.             were originally developed as a part of a new, and as yet
  3317.             unannounced BBS package in conjunction with one of our
  3318.             registered users.  Not only are they useful, in and of
  3319.             themselves, but they also act as examples of using the
  3320.             LiteComm ToolBox in situations that puzzle some users.
  3321.  
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.                                       Page 51
  3365.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3366.  
  3367.  
  3368.  
  3369.  
  3370.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3371.                              for Microsoft and Turbo C
  3372.            _______________________________________________________________
  3373.  
  3374.                                      new_event
  3375.            _______________________________________________________________
  3376.  
  3377.  
  3378.             SUMMARY            SUMMARY            _______
  3379.  
  3380.                  include "lcbbs.h";
  3381.                  
  3382.                  long new_event(sec);
  3383.                  int check_event(evtimer);
  3384.                  
  3385.                  unsinged sec;
  3386.                  long evtimer;
  3387.  
  3388.  
  3389.             DESCRIPTION            DESCRIPTION            ___________
  3390.  
  3391.             The new_event function creates an 'event timer' that will
  3392.             expire in sec seconds.  This function relies upon the
  3393.             calculation of an absolute time value, based upon current
  3394.             date and time, and does not tie into any system intterupt,
  3395.             permitting as many independant time-out timers as required
  3396.             by your application.
  3397.  
  3398.  
  3399.             The check_event function examines the contents of an event
  3400.             timer created by new_event with respect to the current date
  3401.             and time, and indicates whether or not the timer has
  3402.             expired.
  3403.  
  3404.  
  3405.             Do not attempt to use check_event against a variable that
  3406.             was not set by new_event.  If you do so, the results are
  3407.             unpreditaable and may result in a seeming system hang.
  3408.  
  3409.  
  3410.  
  3411.             RETURN VALUES            RETURN VALUES            _____________
  3412.  
  3413.             The new_event function returns a value that represents a
  3414.             point in time sec from the time that new_event was called.
  3415.             The check_event function returns a non-zero (TRUE) value if
  3416.             the specified event timer has expired, a value of zero (0)
  3417.             otherwise.
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.                                       Page 52
  3431.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3432.  
  3433.  
  3434.  
  3435.  
  3436.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3437.                              for Microsoft and Turbo C
  3438.  
  3439.             EXAMPLE            EXAMPLE            _______
  3440.  
  3441.                  long cdtimer;
  3442.                  
  3443.                  cdtimer = new_event(30); /* 30 second timer */
  3444.                  
  3445.                  while( ! check_event(cdtimer))
  3446.                       if (check_for_call(port) > 0)
  3447.                       {
  3448.                            cprintf("Incoming call\r\n");
  3449.                            return(1);
  3450.                       }
  3451.                  
  3452.                  cprintf("No calls in 30 seconds\r\n");
  3453.                  return(0);
  3454.  
  3455.  
  3456.  
  3457.  
  3458.  
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.                                       Page 53
  3497.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3498.  
  3499.  
  3500.  
  3501.  
  3502.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3503.                              for Microsoft and Turbo C
  3504.            _______________________________________________________________
  3505.  
  3506.                                    check_for_call
  3507.            _______________________________________________________________
  3508.  
  3509.  
  3510.             SUMMARY            SUMMARY            _______
  3511.  
  3512.                  include "lcbbs.h";
  3513.                  
  3514.                  int  check_for_call(port)
  3515.                  unsigned port;
  3516.  
  3517.  
  3518.             DESCRIPTION            DESCRIPTION            ___________
  3519.  
  3520.             This function checks the status of the specified port to
  3521.             determine whether or not 1) there is an incoming call and 2)
  3522.             waits for up to 30 seconds for carrier to be established
  3523.             with the caller if the phone rang.  Please note that this
  3524.             function relies upon, in part, the HAYES command set.  Use
  3525.             with other than HAYES-compatible modems may result in
  3526.             uxpected hangs or other, unpredictable results.  The
  3527.             function assumes that the modem parameters have been set in
  3528.             the manner described in the reset_modem function.
  3529.  
  3530.  
  3531.             In the event that a wrong number call is received,
  3532.             check_for_call will automatically disconnect by lowering
  3533.             the DTR(Data Terminal Ready) signal momentarily, then
  3534.             automatically call the reset_modem function.  This
  3535.             disconnect method, while absolute, will only work correctly
  3536.             if you HAVE NOT set your modem to ignore the DTR signals, as
  3537.             is possible with some modems.  Please consult your modem's
  3538.             documentation for additional detail.
  3539.  
  3540.  
  3541.  
  3542.             RETURN VALUES            RETURN VALUES            _____________
  3543.  
  3544.             If the phone was not ringing, the function return a value of
  3545.             zero.  If a ring was detected, but carrier was not detected
  3546.             withing 30 seconds,, the function will return a value of -1
  3547.             after forcing a disconnect and resetting the modem.
  3548.             Otherwise, the numeric result code, in integer form, is
  3549.             returned.  It is the programmer's responsibility to
  3550.             interpret and act upon the result code.  For the function to
  3551.             work properly, the modem must be set to return numeric
  3552.             result codes rather than word result codes.
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.                                       Page 54
  3563.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3564.  
  3565.  
  3566.  
  3567.  
  3568.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3569.                              for Microsoft and Turbo C
  3570.            _______________________________________________________________
  3571.  
  3572.                                   get_modem_reply
  3573.            _______________________________________________________________
  3574.  
  3575.  
  3576.             SUMMARY            SUMMARY            _______
  3577.  
  3578.                  include "lcbbs.h"
  3579.                  
  3580.                  int get_modem_reply(port)
  3581.                  unsigned port;
  3582.  
  3583.  
  3584.             DESCRIPTION            DESCRIPTION            ___________
  3585.  
  3586.             The get_modem_reply function is intended for use after a
  3587.             command has been issued to a HAYES compatible modem.  To
  3588.             operate properly, the modem must be set to return numeric
  3589.             responses rather than word responses.  The function returns
  3590.             to the caller when one of the following occurs: 1) no
  3591.             response from the modem within 1 second; 2) more than 2
  3592.             response characters received before a <CR> is detected; or
  3593.             3) a <CR> is received from the modem.  Due to the internal
  3594.             logic employed, the programmer should call this function, or
  3595.             purge the receive buffer after each command sent to the
  3596.             modem.  Failure to do so will result in improper
  3597.             interpretation of the result codes returned.
  3598.  
  3599.  
  3600.  
  3601.             RETURN VALUES            RETURN VALUES            _____________
  3602.  
  3603.             Returns a value of -1 if no response from the modem is
  3604.             detected within 1 second.  Otherwise returns the integer
  3605.             result code.  If the modem has not been set to return
  3606.             numeric result codes, the results are unpredictable.
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.                                       Page 55
  3629.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3630.  
  3631.  
  3632.  
  3633.  
  3634.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3635.                              for Microsoft and Turbo C
  3636.            _______________________________________________________________
  3637.  
  3638.                                     reset_modem
  3639.            _______________________________________________________________
  3640.  
  3641.  
  3642.             SUMMARY            SUMMARY            _______
  3643.  
  3644.                  include "lcbbs.h"
  3645.                  
  3646.                  int reset_modem(port)
  3647.                  unsigned port;
  3648.  
  3649.  
  3650.             DESCRIPTION            DESCRIPTION            ___________
  3651.  
  3652.             The reset_modem function initializes the modem to a known
  3653.             state, suitable for use with the other bbs functions. The
  3654.             condition set includes tuch tone dialing, detect carrier,
  3655.             numeric result codes, HAYES extended command set, answer the
  3656.             phone on the first ring, and enbale the speaker while
  3657.             dialing.  If you require any additional information on these
  3658.             or related options, please consult your modem's
  3659.             documentation.
  3660.  
  3661.  
  3662.  
  3663.             RETURN VALUES            RETURN VALUES            _____________
  3664.  
  3665.             The reset_modem function returns the same result code as
  3666.             those specified for get_modem_reply.
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.                                       Page 56
  3695.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3696.  
  3697.  
  3698.  
  3699.  
  3700.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3701.                              for Microsoft and Turbo C
  3702.            _______________________________________________________________
  3703.  
  3704.                                      disconnect
  3705.            _______________________________________________________________
  3706.  
  3707.  
  3708.             SUMMARY            SUMMARY            _______
  3709.  
  3710.                  include "lcbbs.h"
  3711.                  
  3712.                  void disconnect(port)
  3713.                  unsigned port;
  3714.  
  3715.  
  3716.             DESCRIPTION            DESCRIPTION            ___________
  3717.  
  3718.             The disconnect forceably disconnects the modem from the
  3719.             telephone line by lowering the DTR signal momentarily.  You
  3720.             must be certain that your modem IS NOT set to ignore the DTR
  3721.             signal for the function to work properly.
  3722.  
  3723.  
  3724.  
  3725.             RETURN VALUES            RETURN VALUES            _____________
  3726.  
  3727.             Disconnect returns no values.
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.                                       Page 57
  3761.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3762.  
  3763.  
  3764.  
  3765.  
  3766.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3767.                              for Microsoft and Turbo C
  3768.            _______________________________________________________________
  3769.  
  3770.                                HAYES MODEM FUNCTIONS;
  3771.            _______________________________________________________________
  3772.  
  3773.             Note - When using the following functions, you must include            ___________________________________________________________
  3774.             the file litehcm.h in your program. litehcm.h automatically            ___________________________________________________________
  3775.             includes the litecomm.h header file.            ____________________________________
  3776.  
  3777.  
  3778.  
  3779.             FUNCTIONS            FUNCTIONS            _________
  3780.  
  3781.                       lch_codeset
  3782.                       lch_dial
  3783.                       lch_fduplex
  3784.                       lch_hduplex
  3785.                       lch_greg
  3786.                       lch_sreg
  3787.                       lch_offcarr
  3788.                       lch_oncarr
  3789.                       lch_offecho
  3790.                       lch_onecho
  3791.                       lch_hook
  3792.                       lch_redo
  3793.                       lch_numres
  3794.                       lch_wrdres
  3795.                       lch_codesoff
  3796.                       lch_codeson
  3797.                       lch_pulse
  3798.                       lch_tone
  3799.                       lch_speaker
  3800.                       _retset
  3801.                       _rettype
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.                                       Page 58
  3827.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3828.  
  3829.  
  3830.  
  3831.  
  3832.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3833.                              for Microsoft and Turbo C
  3834.  
  3835.             SUMMARY            SUMMARY            _______
  3836.  
  3837.                  #include <litehcm.h>
  3838.                  
  3839.                  int lch_codeset(port,mode)
  3840.                  
  3841.                  int lch_dial(port,dstr)
  3842.                  
  3843.                  int lch_fduplex(port)
  3844.                  
  3845.                  int lch_hduplex(port)
  3846.                  
  3847.                  int lch_greg(port,reg)
  3848.                  
  3849.                  int lch_sreg(port,reg,value)
  3850.                  
  3851.                  int lch_offcarr(port)
  3852.                  
  3853.                  int lch_oncarr(port)
  3854.                  
  3855.                  int lch_offecho(port)
  3856.                  
  3857.                  int lch_onecho(port)
  3858.                  
  3859.                  int lch_hook(port,hmode)
  3860.                  
  3861.                  int lch_redo(port)
  3862.                  
  3863.                  int lch_numres(port)
  3864.                  
  3865.                  int lch_wrdres(port)
  3866.                  
  3867.                  int lch_codesoff(port)
  3868.                  
  3869.                  int lch_codeson(port)
  3870.                  
  3871.                  int lch_pulse(port)
  3872.                  
  3873.                  int lch_tone(port)
  3874.                  
  3875.                  int lch_speaker(port,spkmode)
  3876.                  
  3877.                  int _retset()
  3878.                  
  3879.                  int _rettype()
  3880.                  
  3881.                       unsigned port;
  3882.                       unsigned mode;
  3883.                       char *dstr;
  3884.                       unsigned reg;
  3885.                       int value;
  3886.                       unsigned hmode;
  3887.                  unsigned spkmode;
  3888.  
  3889.  
  3890.  
  3891.  
  3892.                                       Page 59
  3893.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3894.  
  3895.  
  3896.  
  3897.  
  3898.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3899.                              for Microsoft and Turbo C
  3900.  
  3901.             DESCRIPTION            DESCRIPTION            ___________
  3902.  
  3903.             The values to be used in conjunction with mode, hmode, and
  3904.             spkmode are defined in the #include-d file litehcm.h.
  3905.  
  3906.  
  3907.             The lch_codeset function allows you to change the set of
  3908.             codes that are returned by the modem when an action is
  3909.             specified.
  3910.  
  3911.  
  3912.             lch_dial instructs the modem to dial the number contained in
  3913.             dstr. Do not include the dialing (ATD) prefix, or the
  3914.             trailing <CR>. These are provided by the function. You may
  3915.             include non-numeric characters as the contents of dstr are
  3916.             not checked. The dialing is done in the last known, pulse or
  3917.             tone, mode. If you use the lch_pulse or lch_tone functions,
  3918.             then dialing will be done in the mode that was last
  3919.             correctly enabled. If you have not exercised these
  3920.             functions, then dialing occurs in the modems default or
  3921.             power-up mode.
  3922.  
  3923.  
  3924.             The lch_hduplex and lch_fduplex functions place the modem
  3925.             into local echo and remote echo modes respectively.
  3926.  
  3927.  
  3928.             The lch_greg function requests that the modem report the
  3929.             current value of S-register reg. Reg must be in the range 0
  3930.             to 13. Use the lch_gets, or similar function, to retrieve
  3931.             the modem's response. Specifying a register outside the 0 to
  3932.             13 range will cause a return of -1.
  3933.  
  3934.  
  3935.             lch_sreg is the companion to lch_greg, with the same
  3936.             restrictions. Sets the S-register reg to the value contained
  3937.             in value. If value contains -1, then the register is reset
  3938.             to its default (power-up) value. The function checks the
  3939.             value to be certain that it is within the limits specified
  3940.             for the particular register, and returns a value of -1 if
  3941.             the value is outside the predefined limits.
  3942.  
  3943.  
  3944.             lch_offcarr enables modem carrier detect, but disables the
  3945.             modems carrier signal. The lch_oncarr companion enables both
  3946.             carrier detect and the modems carrier signal. When
  3947.             lch_offcarr is used the modem will receive data but will be
  3948.             unable to send data.
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.                                       Page 60
  3959.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  3960.  
  3961.  
  3962.  
  3963.  
  3964.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  3965.                              for Microsoft and Turbo C
  3966.  
  3967.             The lch_offecho and lch_onecho functions determine whether
  3968.             commands sent to the modem are echoed back to the sending
  3969.             program. With echo turned off, the modem will continue to
  3970.             accept commands, but will not try to redisplay the command's
  3971.             characters.
  3972.  
  3973.  
  3974.             lch_hook allows you to control the current status of the
  3975.             modem's telephone line connection. See your modem's
  3976.             documentation and the include file for additional
  3977.             information.
  3978.  
  3979.  
  3980.             The lch_redo function instructs the modem to repeat the last
  3981.             command sequence executed. Generally, this function is of
  3982.             greatest value in re-dialing numbers that are busy, although
  3983.             its use is not restricted to that.
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.                                       Page 61
  4025.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  4026.  
  4027.  
  4028.  
  4029.  
  4030.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  4031.                              for Microsoft and Turbo C
  4032.  
  4033.             The way in which your modem responds to commands is
  4034.             determined, in part by the lch_wrdres and lch_numres
  4035.             functions. If you call lch_wrdres, then modem responses use
  4036.             the English language response codes, e.g. CONNECT or OK.
  4037.             Calling lch_numres instructs the modem to respond with code
  4038.             numbers only from the currently selected response set, see
  4039.             the lch_codeset function above.
  4040.  
  4041.  
  4042.             You may use the functions lch_codeson and lch_codesoff to
  4043.             specify whether you want your modem to send back response
  4044.             codes when it receives a command string. In a sense, these
  4045.             act as companions to the lch_xxxecho functions above.
  4046.  
  4047.  
  4048.             Use the lch_speaker function to control the modem's internal
  4049.             speaker, if it has one. See litehcm.h for the applicable
  4050.             codes.
  4051.  
  4052.  
  4053.             The _retset and _rettype functions return, respectively, the
  4054.             last known command set (lch_codeset) and last known result
  4055.             type (lch_wrdres, lch_numres). These functions (_retset,
  4056.             _rettype) are only of value when used in conjunction with
  4057.             the companion functions.
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.                                       Page 62
  4091.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  4092.  
  4093.  
  4094.  
  4095.  
  4096.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  4097.                              for Microsoft and Turbo C
  4098.  
  4099.             GENERAL REMARKS            GENERAL REMARKS            _______________
  4100.  
  4101.             Several considerations are in order if you intend to use the
  4102.             Hayes ToolBox functions.
  4103.  
  4104.  
  4105.  
  4106.                 1. You are responsible for checking the return
  4107.                    codes from the modem once you have given modem a
  4108.                    command. To make the task easier, we suggest
  4109.                    that you turn OFF command echo (so that you
  4110.                    don't have to worry about separating commands
  4111.                    from responses) and turn ON numeric responses
  4112.                    (to make the interpretation of result codes
  4113.                    easier and faster).
  4114.  
  4115.  
  4116.                 2. Be sure that you allow  adequate time between
  4117.                    commands for the modem to process the command
  4118.                    and respond. Failure to observe this rule may
  4119.                    result in commands being misinterpreted or
  4120.                    "lost". You can monitor the number of characters
  4121.                    in the receive buffer to help you with the
  4122.                    timing. Or alternatively, check the response
  4123.                    after each command. The latter approach is more
  4124.                    in line with what we believe to be good
  4125.                    programming practice.
  4126.  
  4127.  
  4128.             RETURN VALUES            RETURN VALUES            _____________
  4129.  
  4130.             All functions return a value of -1 if a port or other error
  4131.             is detected, zero otherwise.
  4132.  
  4133.  
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.                                       Page 63
  4157.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  4158.  
  4159.  
  4160.  
  4161.  
  4162.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  4163.                              for Microsoft and Turbo C
  4164.  
  4165.                               MISCELLANEOUS FUNCTIONS                              MISCELLANEOUS FUNCTIONS                              _______________________
  4166.  
  4167.             These additional functions, while part of the LiteComm            These additional functions, while part of the LiteComm            ______________________________________________________
  4168.             library, are intended for use with LXM, the xmodem engine.            library, are intended for use with LXM, the xmodem engine.            __________________________________________________________
  4169.  
  4170.  
  4171.  
  4172.            _______________________________________________________________
  4173.  
  4174.                                     lc_insclock
  4175.            _______________________________________________________________
  4176.  
  4177.  
  4178.             SUMMARY            SUMMARY            _______
  4179.  
  4180.                  #include <lctime.h>
  4181.                  
  4182.                  int lc_insclock() /* install programmable timer */
  4183.                  
  4184.                  void lc_clrclock() /* remove programmable timer */
  4185.  
  4186.  
  4187.             DESCRIPTION            DESCRIPTION            ___________
  4188.  
  4189.              Install the programmable interval timer at interrupt vector
  4190.             0x1C, if not already installed. You must use this function
  4191.             before attempting to access any of the other functions in
  4192.             this set. In addition, Datalight users must, upon
  4193.             termination of their program, reset the vector by using the
  4194.             lc_clrclock function. Turbo C and Microsoft C users need to
  4195.             know that the an exit() function is installed to
  4196.             automatically replace the vector by calling lc_clrclock.
  4197.  
  4198.  
  4199.  
  4200.             RETURN VALUES            RETURN VALUES            _____________
  4201.  
  4202.             lc_insclock always returns 0, lc_clrclock never returns a
  4203.             value.
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.                                       Page 64
  4223.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  4224.  
  4225.  
  4226.  
  4227.  
  4228.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  4229.                              for Microsoft and Turbo C
  4230.            _______________________________________________________________
  4231.  
  4232.                                     lc_setclock
  4233.            _______________________________________________________________
  4234.  
  4235.  
  4236.             SUMMARY            SUMMARY            _______
  4237.  
  4238.                  #include <lctime.h>
  4239.                  
  4240.                  void lc_setclock(secs)
  4241.                  
  4242.                       unsigned secs;
  4243.  
  4244.  
  4245.             DESCRIPTION            DESCRIPTION            ___________
  4246.  
  4247.             Sets the programmable timer to the number of seconds
  4248.             specified in secs. The amount of time remaining on the
  4249.             clock, in seconds, can be examined in the _secs_rem
  4250.             variable, defined in lctime.h. _secs_rem will never decrease
  4251.             below a value of zero.
  4252.  
  4253.  
  4254.  
  4255.             RETURN VALUES            RETURN VALUES            _____________
  4256.  
  4257.             lc_setclock never returns a value.
  4258.  
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.                                       Page 65
  4289.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  4290.  
  4291.  
  4292.  
  4293.  
  4294.                         LITECOMM (TM) COMMUNICATIONS TOOLBOX
  4295.                              for Microsoft and Turbo C
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.  
  4304.  
  4305.  
  4306.  
  4307.  
  4308.  
  4309.  
  4310.  
  4311.  
  4312.  
  4313.  
  4314.  
  4315.  
  4316.  
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.                                       Page 66
  4355.                CopyRight (c) 1987, 1988 Information Technology, Ltd.
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.                                  REGISTRATION FORM                                 REGISTRATION FORM                                 _________________
  4362.  
  4363.             Please complete the following information. Note that the
  4364.             prices below are for a single-use registration only. Please
  4365.             contact us directly for site licensing.
  4366.  
  4367.             Mail to:
  4368.                  Information Technology
  4369.                  PO Box 554
  4370.                  Coventry, RI 02816
  4371.                  Telephone Orders or Information (401) 826-2223
  4372.             ┌──────────────────────────────────────────────────────────┐
  4373.             │ SHIP TO:                                                 │
  4374.             │ Name    ________________________________________         │
  4375.             │                                                          │
  4376.             │ Company ________________________________________         │
  4377.             │                                                          │
  4378.             │ Street  ________________________________________         │
  4379.             │                                                          │
  4380.             │         ________________________________________         │
  4381.             │                                                          │
  4382.             │ City    ___________________  State __  Zip _____         │
  4383.             │                                                          │
  4384.             │ Telephone _______________________                        │
  4385.             ├─────┬──────────┬───────────────────┬─────────────────────┤
  4386.             │     │          │                   │                     │
  4387.             │ QTY │ COMPILER │ REGISTRATION TYPE │ REGISTRATION FEE    │
  4388.             │     │          │                   │                     │
  4389.             ├─────┼──────────┼───────────────────┼─────────────────────┤
  4390.             │     │          │                   │                     │
  4391.             │     │          │ LIBRARIES @ $25   │                     │
  4392.             │     │          │                   │                     │
  4393.             ├─────┼──────────┼───────────────────┼─────────────────────┤
  4394.             │     │          │                   │                     │
  4395.             │     │          │ LIBRARIES AND     │                     │
  4396.             │     │          │ SOURCE  @ $50     │                     │
  4397.             │     │          │                   │                     │
  4398.             ├─────┼──────────┼───────────────────┼─────────────────────┤
  4399.             │     │          │ 3.5 " Disk ? $1.00│                     │
  4400.             │     │          │                   │                     │
  4401.             │     │          │ RI Sales Tax 6%   │                     │
  4402.             └─────┴──────────┴───────────────────┴─────────────────────┘
  4403.             Method of Payment (Check, Mastercard, Visa) _____________
  4404.             
  4405.                  Credit Card Number __________________________
  4406.             
  4407.                  Expiration Date __________________________
  4408.             
  4409.                  Name as it appears on card ___________________________
  4410.             
  4411.                  Signature for MC/VISA ________________________________
  4412.             
  4413.             All MasterCard/Visa orders must include a telephone number,
  4414.             
  4415.             We regret that we cannot accept COD orders
  4416.            _______________________________________________________________
  4417.             (office use only)
  4418.                 Date Received ______________ Date Sent _____________
  4419.                 Version ______________ Serial Number _______________
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.                 OVERVIEW........................................... 1
  4431.                     FEATURES....................................... 1
  4432.                     THE SHAREWARE CONCEPT.......................... 1
  4433.  
  4434.                 LICENSE, WARRANTY AND REGISTRATION................. 2
  4435.                     LICENSE........................................ 2
  4436.                     WARRANTY....................................... 3
  4437.                     REGISTERING YOUR COPY.......................... 4
  4438.                     NOTE........................................... 5
  4439.  
  4440.                 COMMUNICATIONS AND THE PC.......................... 6
  4441.                     PC SHORTCOMINGS................................ 6
  4442.                     THE 8250 UART.................................. 6
  4443.                     SIGNAL DESCRIPTIONS............................ 8
  4444.  
  4445.                 TOOLBOX NOTES AND WARNINGS......................... 8
  4446.  
  4447.                 RECENT CHANGES..................................... 11
  4448.                     NEW IN VERSION 2.XX............................ 11
  4449.                     NEW IN VERSION 3.00............................ 13
  4450.                     NEW IN VERSION 4.00............................ 14
  4451.  
  4452.                 BEYOND COM2........................................ 15
  4453.                     THE TOOLBOX METHODOLOGY........................ 15
  4454.                     CAUTIONS....................................... 16
  4455.  
  4456.                 PACKAGE CONTENTS................................... 19
  4457.  
  4458.                 COMPILER-SPECIFIC INSTRUCTIONS..................... 20
  4459.                     INSTALLING THE TURBO C VERSION................. 20
  4460.                     INSTALLING THE MICROSOFT C VERSION............. 22
  4461.                     GENERAL NOTES.................................. 25
  4462.  
  4463.                 FUNCTION REFERENCE................................. 27
  4464.  
  4465.                 BBS SUPPORT FUNCTIONS.............................. 51
  4466.  
  4467.                 HAYES MODEM FUNCTIONS.............................. 58
  4468.                     GENERAL REMARKS................................ 63
  4469.  
  4470.                 MISCELLANEOUS FUNCTIONS............................ 64
  4471.  
  4472.                 REGISTRATION FORM.................................. 67
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.  
  4496.  
  4497.  
  4498.  
  4499.  
  4500.  
  4501.  
  4502.  
  4503.  
  4504.  
  4505.  
  4506.  
  4507.  
  4508.  
  4509.  
  4510.  
  4511.  
  4512.  
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.      8250 6, 8                                              lch_fduplex  58
  4559.      8259 15                                              lch_greg     58
  4560.      _portchg  15                                              lch_hduplex  58
  4561.      _secs_rem 65                                              lch_hook     58
  4562.      Asynchronous   7                                              lch_numres   58
  4563.      BIOS 6, 16                                              lch_offcarr  58
  4564.      Bit number     28                                              lch_offecho  58
  4565.      BREAK     50                                              lch_oncarr   58
  4566.      Buffers   10, 30                                              lch_onecho   58
  4567.      Clocking-in    7                                              lch_pulse    58
  4568.      COM3 16, 28                                              lch_redo     58
  4569.      COM4 16, 28                                              lch_speaker  58
  4570.      Control block  10                                              lch_sreg     58
  4571.      Dialing   60                                              lch_tone     58
  4572.      DTR  54, 57                                              lch_wrdres   58
  4573.      Event timer    52                                            Interrupt enable flag    10
  4574.      Flow control   41                                            Interrupt request   15
  4575.      Functions                                            Interrupt vector    15
  4576.        _portchg     28                                            Interrupts     7
  4577.        check_for_call    54                                            IRQ  16
  4578.        comm_close   31                                            Memory    10
  4579.        comm_opn     30                                            Numeric result code 54
  4580.        comm_setup   32                                            Port 25
  4581.        disconnect   57                                            S-register     60
  4582.        get_modem_reply   55                                            Serial port    6
  4583.        lc_clrmdm    39                                            Start bit 7
  4584.        lc_estat     36                                            Stop bits 7
  4585.        lc_flush     49                                            Structure alignment 10
  4586.        lc_get  44                                            TSR  25
  4587.        lc_gets 47                                            XOFF 41, 42, 43
  4588.        lc_getw 37                                            XON  41, 42, 43
  4589.        lc_gotbrk(port)
  4590.          
  4591.           unsigned port  50
  4592.        lc_gotxoff   42
  4593.        lc_icnt 34
  4594.        lc_insclock  64
  4595.        lc_mstat     35
  4596.        lc_ocnt 34
  4597.        lc_peek 45
  4598.        lc_put  46
  4599.        lc_puts 48
  4600.        lc_putxoff   43
  4601.        lc_sbrk 50
  4602.        lc_setclock  65
  4603.        lc_setmdm    38
  4604.        lc_togmdm    40
  4605.        lc_vport     33
  4606.        lc_xoff 41
  4607.        new_event    52
  4608.        reset_modem  56
  4609.      Handshake 8
  4610.      HAYES     54, 55, 56
  4611.      Hayes Functions
  4612.        _retset 58
  4613.        _rettype     58
  4614.        lch_codeset  58
  4615.        lch_codesoff 58
  4616.        lch_codeson  58
  4617.        lch_dial     58
  4618.  
  4619.                                           1
  4620.  
  4621.